|
From: Raphael S. <rap...@gm...> - 2012-12-17 16:25:02
|
Thanks.
In my case it was a bit more complex.
I'm using jboss 7.2.0.Alpha.
I tried to update all resteasy modules to 2.3.5.Final, but it didn't work.
So, I rolled it back, and updated only resteasy-multipart-provider to 2.3.5.
I kept all other resteasy modules in version 2.3.3.
It worked. I managed to set the part media type to utf-8 and it did the
trick!
Do you think it's ok to keep it like that?
On Mon, Dec 17, 2012 at 1:30 PM, Bill Burke <bb...@re...> wrote:
> If the content-type of the part doesn't have a charset, it will just be
> converted to us-ascii...
>
> But, InputPart has a setMediaType method that you can use before the
> part is extracted.
>
> inputPart.setMediaType("text/plain;charset=utf-8");
>
>
> This fix was introduced 2.3.5
>
> On 12/17/2012 7:57 AM, Raphael Silva wrote:
> > Hi guys,
> >
> > I have a multipart upload service defined as this:
> >
> > @POST
> > @Consumes(MediaTypeExt.MULTIPART_FORM_DATA)
> > @Produces(MediaTypeExt.TEXT_PLAIN)
> > public Response postProcesso(final MultipartInput uploadForm) throws
> > Exception {
> >
> > And I'm getting the file name:
> > part.getHeaders().getFirst("Content-Disposition") and the file content:
> > part.getBody(byte[].class, null)
> >
> > The problem is that the file is UTF-8 encoded, but when I get the bytes
> > from the part body it seems to be converted to another encoding, and I
> > can't receive the file content properly.
> >
> > How can I receive a file from multipart post as UTF-8?
> >
> > Thanks in advance!
> >
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> > Remotely access PCs and mobile devices and provide instant support
> > Improve your efficiency, and focus on delivering more value-add services
> > Discover what IT Professionals Know. Rescue delivers
> > http://p.sf.net/sfu/logmein_12329d2d
> >
> >
> >
> > _______________________________________________
> > Resteasy-developers mailing list
> > Res...@li...
> > https://lists.sourceforge.net/lists/listinfo/resteasy-developers
> >
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
|