cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: JAX-RS client: Content disposition for multiple items on multipart requests?
Date Tue, 06 Dec 2011 14:13:51 GMT
Hi
On 06/12/11 13:52, dra wrote:
> Hi Sergey.
>
> Wow, thank you so much! The code is working like a charm since I used the
> following snippet:
>
> ContentDisposition cd = new ContentDisposition("form-data;
> name=\"textfield\"");
> ContentDisposition cd2 = new ContentDisposition("form-data; name=\"file\";
> filename=\"image.png\"");
> List<Attachment>   atts = new LinkedList<Attachment>();
> atts.add(new Attachment("key", new
> ByteArrayInputStream("my_textfield_value".getBytes()), cd));
> atts.add(new Attachment("file", new FileInputStream(uploadFile), cd2));
>
> Setting the content type manually for the text field was not even necessary.
>
Great, I have to document those constructors better :-). May be even 
deprecate the one expecting a String media type and replace it with 
MediaType to avoid unexpected results

Thanks, Sergey
> Thanks alot, again!
> Bye, Daniel
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-client-Content-disposition-for-multiple-items-on-multipart-requests-tp5051629p5052125.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Mime
View raw message