Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 876E6C5E6 for ; Fri, 9 Jan 2015 12:23:33 +0000 (UTC) Received: (qmail 49205 invoked by uid 500); 9 Jan 2015 12:23:34 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 49150 invoked by uid 500); 9 Jan 2015 12:23:34 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 49138 invoked by uid 99); 9 Jan 2015 12:23:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2015 12:23:34 +0000 Date: Fri, 9 Jan 2015 12:23:34 +0000 (UTC) From: "MaiZhang (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1594) MultipartEntity doesn't work when I set Charset for it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1594?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D14270947#comment-14270947 ]=20 MaiZhang commented on HTTPCLIENT-1594: -------------------------------------- And I find the same problem in another programer's blog =E5=8F=91=E8=87=AA=E7=BD=91=E6=98=93=E9=82=AE=E7=AE=B1 iPhone =E7=89=88 =E5=9C=A82015=E5=B9=B401=E6=9C=8809=E6=97=A5 19:16=EF=BC=8C"Oleg Kalnichevs= ki (JIRA)" =E5=86=99=E9=81=93: [ https://issues.apache.org/jira/browse/HTTPCLIENT-1594?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D14270889#comment-14270889 ]=20 Oleg Kalnichevski commented on HTTPCLIENT-1594: ----------------------------------------------- And what makes you think this is a problem with HttpClient and not with the= server? Oleg=20 -- This message was sent by Atlassian JIRA (v6.3.4#6332) > MultipartEntity doesn't work when I set Charset for it > ------------------------------------------------------ > > Key: HTTPCLIENT-1594 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-159= 4 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpMime > Affects Versions: 4.2.6 > Environment: Client info: Android,Sumsung note3 > Server info: php server > Reporter: MaiZhang > Labels: features > > I need upload files to my server,but the file name maybe Chinese.So I wan= t to set charset to MultipartEntity,cuz its default charset is US-ASCII,the= file name be sended to server looks like "?????.txt" eg. .But, when I set = UTF-8 to it,the server can't get any data. > MultipartEntity mult =3D new MultipartEntity(); > =09=09=09mult.addPart("k", new StringBody(getAccessToken().getAccessToken= ())); > =09=09=09mult.addPart("attfile", new FileBody(new File(entity.getFilePath= ()))); > This code works well,but:::::: > MultipartEntity mult =3D new MultipartEntity(null,null,Charset.forName("U= TF-8")); > =09=09=09mult.addPart("k", new StringBody(getAccessToken().getAccessToken= ())); > =09=09=09mult.addPart("attfile", new FileBody(new File(entity.getFilePath= ()))); > can't post data to server,it's too strange!!! > AND!!!!!!! > if I use=20 > MultipartEntity mult =3D new MultipartEntity();=20 > this way and set breakpoint at the second line,and change the value of m= ultipart-charset-canonicalName to "UTF-8",the server will get the right fil= e name,I think if I set charset to a MultipartEntity object,it will not wor= k. > And, I tested httpmime4.3.x,by MultipartEntityBuilder,it doesn't work too= . -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org