filename*=UTF-8''... #2007

Open
kengruven opened this Issue Oct 6, 2015 · 2 comments

Comments

Projects
None yet
4 participants
@kengruven

When letting a user download a file, you can put a "filename=" in the content-disposition field to suggest to the client what to save it as.

It looks like this field is somewhere between "not fully specified" and "not consistently implemented", especially for non-ASCII encodings.

I think RFC-6266 says that something like this should work:

filename*=UTF-8''blahblahblah

where blahblahblah is UTF-8-encoded text. (That's two adjacent single-quotes at the start, not an un matched double-quote.)

But there are also apparently lots of other RFCs to choose from, and the various browser vendors appropriately picked their favorites. I tried the above with Firefox and Safari just now, and they each did something different, and neither gave me a file called blahblahblah.

It would be great if caniuse had something for the content-disposition filename= feature!

@Ugoku

This comment has been minimized.

Show comment
Hide comment
@Ugoku

Ugoku Oct 16, 2015

Contributor

Tested: filename*=UTF-8''ßfoobar.zip in a script called download.php
Windows 10, x64

Opera 32, Firefox 41, Chrome 45/46 all download as download.php
IE11 and Edge both download with the correct filename!

Contributor

Ugoku commented Oct 16, 2015

Tested: filename*=UTF-8''ßfoobar.zip in a script called download.php
Windows 10, x64

Opera 32, Firefox 41, Chrome 45/46 all download as download.php
IE11 and Edge both download with the correct filename!

@alecpl

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment