Parsing content-disposion header's filename in multipart/from-data
- by Artyom
Hello According to RFC, in multipart/form-data content-disposition header
filename field receives as parameter HTTP quoted string - string between quites where
character '\' can escape any other ascii character.
Problem web browsers don't do it.
IE6 sends:
Content-Disposition: form-data; name="file"; filename="z:\tmp\test.txt"
Instead of expected
Content-Disposition: form-data; name="file"; filename="z:\\tmp\\test.txt"
Which should be parsed as z:tmptest.txt according to rules instead of z:\tmp\test.txt.
Firefox, Konqueror and Chrome don't escape " characters for example:
Content-Disposition: form-data; name="file"; filename=""test".txt"
Instead of expected
Content-Disposition: form-data; name="file"; filename="\"test\".txt"
So... how would you suggest to deal with this issue?