On Mon, 2008-02-25 at 16:48 +0000, Andy Wu wrote:
> Hi,
> 
> When making a multipart post uploading a file with a filename containing 
> non-ascii characters, the filename appears to be incorrect written to 
> the http request.
> 
> If you look at the code, sendDispositionHeader() essentially sends the 
> filename.getBytes( "US-ASCII" ):
> 
>   
> http://hc.apache.org/httpclient-3.x/xref/org/apache/commons/httpclient/methods/multipart/FilePart.html
> 
> However, the browsers I've tested with will send the filename.getBytes( 
> "ISO-8859-1" ) version of the filename and thus the software that's I'm 
> working with that receives the upload is decoding the filename correctly.
> 
> Would anyone else concur that this is a bug?
> 

Andy,

This is definitely not a bug. Non-ASCII characters are not allowed to be
present in the MIME elements such disposition headers. Common browser
applications violate the MIME spec. Plain and simple.

For those who do not give a flying damn about standards compliance,
HttpClient as of release 4.0-alpha3 provides a browser compatibility
mode for multipart coded entities.   

Hope this helps

Oleg

> Thanks
> Andy Wu
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to