Upload via a browser?

Server side:

     @POST
     @Consumes(MediaType.MULTIPART_FORM_DATA)
     public Response uploadRealm(MultipartFormDataInput input) throws 
IOException  {
         Map<String, List<InputPart>> uploadForm = input.getFormDataMap();
         List<InputPart> inputParts = uploadForm.get("file");

         for (InputPart inputPart : inputParts) {
             inputPart.setMediaType(MediaType.APPLICATION_JSON_TYPE);
             MyClass rep = inputPart.getBody(new GenericType<MyClass>(){});
         }
         return Response.noContent().build();
     }


On 2/16/2014 1:17 PM, John D. Ament wrote:
> Hi all,
>
> Just wondering if there are any pointers to how to best handle a file
> upload via RestEasy's NettyJaxrsServer?  When I was doing it via an
> app server, it was easy because there was an HTTP request.  Would
> injecting @Context HttpServletRequest still work here?  I'm inclined
> to think not but would be curious of other opinions.
>
> John
>
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to