users@jersey.java.net

[Jersey] Re: How to post a file and other form fields by Jersey client

From: Jitesh <jiteshks_at_yahoo.com>
Date: Wed, 22 Jun 2011 11:31:01 -0700 (PDT)

I have modified client code to look like this -

FormDataMultiPart formData = new FormDataMultiPart() ;
                
                formData.field("sourceLanguage",sourceLanguage) ;
                
                
                formData.field("targetLanguage",targetLanguage) ;
                formData.field("inputFormat",inputFormat) ;
                formData.field("tmx",tmx) ;
                formData.bodyPart(new FileDataBodyPart("uploadFile",file)) ;
                formData.field("priority",priority) ;
                
                
                
                ClientResponse response =
service.type(MediaType.MULTIPART_FORM_DATA).header("appKey",appkey).post(ClientResponse.class,formData);
                

Even then I keep getting file as blank on server side.

--
View this message in context: http://jersey.576304.n2.nabble.com/How-to-post-a-file-and-other-form-fields-by-Jersey-client-tp6502947p6505507.html
Sent from the Jersey mailing list archive at Nabble.com.