I ran into a problem while trying to service Spanish tilde files related to Content-Disposition encoding.
File Name: "qué hacés ahora.docx"
So far, the ASP.NET MVC way of serving files adds this header, which only works fine in Firefox:
Content-Disposition: attachment; filename*=UTF-8''qu%C3%A9%20hac%C3%A9s%20ahora.docx
I use in the controller:
return File(path, "application/octet-stream", originalNameWithAccents);
This does not work in IE or Chrome.
So, I sent and sent the file itself as an application using GMail. Using firebug to see what happens, Google Content-Disposition sends back:
Content-Disposition: attachment; filename="=?UTF-8?B?cXXDqSBoYWPDqXMgYWhvcmEuZG9jeA==?="
Notice how the name is encoded with base64 (cXXDqSBoYWPDqXMgYWhvcmEuZG9jeA ==).
So, I have 2 questions:
- Where is the specification for this?
- Are there any known ways to serve this type of file name using ASP.NET?