This article is a mirror article of machine translation, please click here to jump to the original article.

View: 203|Reply: 0

[ASP.NET] ASP.NET Core (33) File Output Download (Chinese file name)

[Copy link]
Posted on 2025-11-10 13:22:15 | | | |
Requirements: Use the ASP.NET Core interface to provide file download services, for Chinese files, if the code is not written properly, the browser download will cause garbled characters.

Review:
Java oss Alibaba Cloud upload file settings download file name
https://www.itsvse.com/thread-7853-1-1.html

Download the interface code as follows:
As shown below:



Response header:
content-disposition
attachment; filename=___itsvse.xlsx; filename*=UTF-8''%E6%9E%B6%E6%9E%84%E5%B8%88itsvse.xlsx

The server detects that the Chinese file name cannot be transmitted securely, so it automatically falls back or filters it as a placeholder.

The only difference between the filename and filename* parameters is that filename* is encoded as specified in RFC 5987.When filename and filename* appear together, filename* should be used first, if both are supported

Reference:

The hyperlink login is visible.
The hyperlink login is visible.
The hyperlink login is visible.




Previous:Nginx website HTTPS optimized OCSP binding
Next:Docker images the difference between Manifest digest and Index digest
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com