How to encode the filename parameter of Content-Disposition header in HTTP?

I know this is an old post but it is still very relevant. I have found that modern browsers support rfc5987, which allows utf-8 encoding, percentage encoded (url-encoded). Then Naïve file.txt becomes: Content-Disposition: attachment; filename*=UTF-8”Na%C3%AFve%20file.txt Safari (5) does not support this. Instead you should use the Safari standard of writing the file name directly in … Read more