Hi Paul,
1) No
POST /projects/1/vulnerabilities/29/evidences/9/attachments HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Referer:
http://localhost:8080/projects/1/vulnerabilities/29/evidences/9/attachments/new
Cookie: JSESSIONID=4e0e10d1e122370548a6bf6126af
Content-Type: multipart/form-data; boundary=---------------------------112241574819923
Content-Length: 1594
-----------------------------112241574819923
Content-Disposition: form-data; name="name"
Això és una evidència
-----------------------------112241574819923
Content-Disposition: form-data; name="description"
Això és una evidència
-----------------------------112241574819923
Content-Disposition: form-data; name="filename"; filename="favicon.ico"
Content-Type: image/x-icon
......
2) It works in my pc, packed war and will try on preproduction server.
Thanks :)
BTW i found another issue, sending an attachment with firefox and asking for filename fdbp.getContentDisposition().getParameters().get("filename");
i get the filename favicon.ico but with iexplore i get c:favicon.ico. Im not sure if this is something multipart must be aware.
Thanks, I will update when i know how it works in preproduction.
Jordi
> Date: Mon, 2 Nov 2009 12:04:08 +0100
> From: Paul.Sandoz_at_Sun.COM
> To: users_at_jersey.dev.java.net
> Subject: Re: [Jersey] Multipart Form And Encoding
>
> Hi Jordi,
>
> I have verified there is a bug in the FormDataBodyPart.getValue
> method. It is ignoring the charset parameter (if present) on the media
> type.
>
> In fact this method is doing it's own string parsing when it should be
> deferring to the string reader provided of the message body reader.
>
> Can you:
>
> 1) verify there is a charset parameter present on the Content-Type of
> the body part identified as "name"; and
>
> 2) try doing the following and seeing if that works (which depends on
> a charset parameter with a value of "ISO-8859-1" being present)
>
> multiPart.getField("name").getValueAs(String.class);
>
> Paul.
>
>
>
> On Nov 2, 2009, at 11:49 AM, Jordi Domingo wrote:
>
> > Hi,
> >
> > I've got some problems with char encoding using multipart API. I've
> > been able to solve this in my pc using:
> >
> > String name = multiPart.getField("name").getValue();
> > name = new String(name.getBytes("ISO-8859-1"), "UTF-8");
> >
> > But in production it is not working. Chars like àáèéìí ... are shown
> > like ??
> >
> > Any help is appreciated. Thanks,
> >
> > Jordi
> >
> > Entra al Nuevo Canal Motor y descubre por qué los coches más rápidos
> > sólo aparcan en MSN. Nuevo diseño, más completo y abierto a tu
> > opinión.¡Nuevo Canal Motor!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
_________________________________________________________________
Convierte las fotos que más te gustan en tu nuevo fondo de escritorio para el ordenador. Es fácil y además gratis
http://wallpapers.msn.com/es-es
--_25bb02e6-7070-45b5-9f2f-e3b25861363e_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi Paul,<br><br>1) No<br><br>POST /projects/1/vulnerabilities/29/evidences/9/attachments HTTP/1.1<br>Host: localhost:8080<br>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14 (.NET CLR 3.5.30729)<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br>Accept-Language: en-us,en;q=0.5<br>Accept-Encoding: gzip,deflate<br>Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>Keep-Alive: 300<br>Proxy-Connection: keep-alive<br>Referer:
http://localhost:8080/projects/1/vulnerabilities/29/evidences/9/attachments/new<br>Cookie: JSESSIONID=4e0e10d1e122370548a6bf6126af<br>Content-Type: multipart/form-data; boundary=---------------------------112241574819923<br>Content-Length: 1594<br><br>-----------------------------112241574819923<br>Content-Disposition: form-data; name="name"<br><br>Això és una evidència<br>-----------------------------112241574819923<br>Content-Disposition: form-data; name="description"<br><br>Això és una evidència<br>-----------------------------112241574819923<br>Content-Disposition: form-data; name="filename"; filename="favicon.ico"<br>Content-Type: image/x-icon<br><br>......<br><br>2) It works in my pc, packed war and will try on preproduction server. <br><br>Thanks :)<br><br>BTW i found another issue, sending an attachment with firefox and asking for filename fdbp.getContentDisposition().getParameters().get("filename");<br>i get the filename favicon.ico but with iexplore i get c:favicon.ico. Im not sure if this is something multipart must be aware.<br><br>Thanks, I will update when i know how it works in preproduction.<br><br>Jordi<br><br><br>> Date: Mon, 2 Nov 2009 12:04:08 +0100<br>> From: Paul.Sandoz@Sun.COM<br>> To: users@jersey.dev.java.net<br>> Subject: Re: [Jersey] Multipart Form And Encoding<br>> <br>> Hi Jordi,<br>> <br>> I have verified there is a bug in the FormDataBodyPart.getValue <br>> method. It is ignoring the charset parameter (if present) on the media <br>> type.<br>> <br>> In fact this method is doing it's own string parsing when it should be <br>> deferring to the string reader provided of the message body reader.<br>> <br>> Can you:<br>> <br>> 1) verify there is a charset parameter present on the Content-Type of <br>> the body part identified as "name"; and<br>> <br>> 2) try doing the following and seeing if that works (which depends on <br>> a charset parameter with a value of "ISO-8859-1" being present)<br>> <br>> multiPart.getField("name").getValueAs(String.class);<br>> <br>> Paul.<br>> <br>> <br>> <br>> On Nov 2, 2009, at 11:49 AM, Jordi Domingo wrote:<br>> <br>> > Hi,<br>> ><br>> > I've got some problems with char encoding using multipart API. I've <br>> > been able to solve this in my pc using:<br>> ><br>> > String name = multiPart.getField("name").getValue();<br>> > name = new String(name.getBytes("ISO-8859-1"), "UTF-8");<br>> ><br>> > But in production it is not working. Chars like àáèéìí ... are shown <br>> > like ??<br>> ><br>> > Any help is appreciated. Thanks,<br>> ><br>> > Jordi<br>> ><br>> > Entra al Nuevo Canal Motor y descubre por qué los coches más rápidos <br>> > sólo aparcan en MSN. Nuevo diseño, más completo y abierto a tu <br>> > opinión.¡Nuevo Canal Motor!<br>> <br>> <br>> ---------------------------------------------------------------------<br>> To unsubscribe, e-mail: users-unsubscribe@jersey.dev.java.net<br>> For additional commands, e-mail: users-help@jersey.dev.java.net<br>> <br> <br /><hr />Entra al Nuevo Canal Motor y descubre por qué los coches más rápidos sólo aparcan en MSN. Nuevo diseño, más completo y abierto a tu opinión. <a href='
http://motor.es.msn.com/' target='_new'>¡Nuevo Canal Motor! </a></body>
</html>
--_25bb02e6-7070-45b5-9f2f-e3b25861363e_--