hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: UTF-8 encoding of MultipartRequestEntity
Date Wed, 24 Oct 2007 08:26:52 GMT

On Tue, 2007-10-23 at 07:06 -0700, Ahmed Ashour wrote: 
> Dear all,
>  
> On trying to upload a file whose name contains UTF-8 characters in Windows, the server
side reads question marks instead, below is the code used.
>  
> However, it works fine when submitting the request from IE7.
>  
> Any idea about how to change the encoding?
>  
> Thanks a lot for your help.
>  
> -Ahmed
>  
> ----------------------------------------------------------------------------------
>         File f = ........;
>         PostMethod filePost = new PostMethod("http://localhost/url/upload");
>         Part[] parts = {new FilePart(f.getName(), f)};
>         filePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams()));
>         HttpClient client = new HttpClient();
>         int status = client.executeMethod(filePost);
> 
> ----------------------------------------------------------------------------------
> 

Ahmed

Is this related to the comment you posted to HTTPCLIENT-293? 

https://issues.apache.org/jira/browse/HTTPCLIENT-293#action_12537217  

Anyways, we are evaluating different options of providing an improved
support for multipart coded entities in HttpClient 4.0 including a
lenient (browser compatibility) mode. 

If you need to emulate non-standard browser behaviors posting multipart
coded entities with Httpclient 3.1 the only option you have is to
implement a custom RequestEntity

Hope this helps

Oleg

> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 


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


Mime
View raw message