: A parameter enclosed in double quotes that provides the default name for the saved file. Handling Special Characters (Unicode & UTF-8)
: Tells the browser to download the file (usually opening a "Save As" dialog) rather than trying to display it in the browser window. file download header filename
To trigger a download and suggest a filename, the header follows this structure: Content-Disposition: attachment; filename="example.pdf" : A parameter enclosed in double quotes that
: Modern browsers (Chrome, Firefox, Safari, Edge) prioritize this value. It uses a specific format: encoding'language'percent-encoded-name . Implementation Examples Content-Disposition header - HTTP - MDN Web Docs : Tells the browser to try and display
Standard filename parameters are restricted to characters. To support international characters (like accents or non-Latin scripts), RFC 6266 introduced the filename* parameter.
: Tells the browser to try and display the file inside the tab (like a PDF or image) while still providing a suggested name if the user later chooses to save it.
The correct way to support all browsers is to provide both: Content-Disposition: attachment; filename="fallback.txt"; filename*=UTF-8''%d0%bd%d0%b0%d0%b7%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5.txt : Acts as a fallback for older browsers.