hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tumidajewicz, Przemyslaw" <przemyslaw.tumidajew...@desy.de>
Subject Re: [HTTPClient 3.0.1] Bug: Multipart posts with files named using UTF-8 characters
Date Thu, 19 Oct 2006 13:15:09 GMT
Hello Ortwin,

 > I haven't tried myself. What happens when you send the form blow with
 > a browser? Does it set the Content-Encoding header of the HTTP message
 > to UTF-8? Because the server must have a way to know in which encoding
 > to interprete the MIME header if it's not the default ASCII.

Browsers I've checked (IE6, Firefox 1.5, Opera 7.54) are not sending a 
Content-Encoding header. IE6 and Firefox encode the filename properly 
and Opera corrupts it by removing all non-ASCII characters.

The request looks like this (from IE6):

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
application/x-shockwave-flash, application/vnd.ms-excel, 
application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: pl
Content-Type: multipart/form-data; 
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
EmbeddedWB 14,52 from: http://www.bsalsa.com/ EmbeddedWB 14,52; .NET CLR 
1.1.4322; .NET CLR 2.0.50727)
Host: ipppub02.desy.de:1235
Content-Length: 262
Connection: Keep-Alive
Cache-Control: no-cache

Content-Disposition: form-data; name="file"; 
filename="C:\Desy2\^°!²§³$% & { ( [ ) ] = } ß@ü Ü  +~
Content-Type: text/plain


The weird looking filename is my test bunch of special characters 
Windows allowed me to use in a filename - and it's in UTF-8 (what might 
not be obvious from the listing above).

I guess a Content-Encoding header would appear if I added an appropriate 
  META tag in my HTML (I'm only using accept-charset attribute in the 
FORM tag currently), but it seems to work without it - FileUpload 
interprets this filename properly without any hints on the encoding 
(perhaps it's just using UTF-8 as default?).

Hope this helps,

To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org

View raw message