Proper enconding of Content-Dispisition filename#71
Conversation
|
Great work 👍 |
|
@dg Of course encode :-) Updated. |
|
Should it be |
|
@dg I tried current approach with |
|
Can you add prefix |
|
Btw Test Cases for HTTP Content-Disposition header field http://greenbytes.de/tech/tc2231/ |
…ld not contain non-US-ASCII characters. Proper way to encode filename is this: "filename*=utf-8''%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88.txt". Unfortunately, RFC 5987 is not supported by all browsers, so for compatibility reasons, filename should be sent like this: "filename=žluťoučký kůň.txt; filename*=utf-8''%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88.txt".
|
Prefix added, I'll look to your link more tomorrow, but according to what I've read my solution should work just fine. |
Proper enconding of Content-Dispisition filename
|
Thanks! |
|
@dg When you plan next release (2.3.2)? |
|
Soon |
According to RFC 5987 Content-Disposition filename should not contain non-US-ASCII characters.
Proper way to encode filename is this:
"filename*=utf-8''%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88.txt".
Unfortunately, RFC 5987 is not supported by all browsers, so for compatibility reasons, filename should be sent like this:
"filename=žluťoučký kůň.txt; filename*=utf-8''%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88.txt".
Some discussion about this is here: http://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http