You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by lolo13100 <la...@hotmail.com> on 2012/01/20 11:43:59 UTC

Prob uploading file with pics

Hi !

I've a strange problem with the uploading file with pics.

When I uplaod a simple RTF file the content of the file is ok. But when I
insert the same file with a simple pics inside the content of the file is
empty.

Please find my interface : 
@POST
@Consumes("multipart/form-data")
public Response sendFaxPost(MultipartBody attachment) throws Exception {

// presumes the part has a content id
Attachment a = attachment.getAttachment("FXS_ATTACHMENT");
InputStream rtf = a.getDataHandler().getInputStream();
//write file to filesystem
....}

First case (simple RTF): file is ok
Second case (same RTF with simple jpg inside ): file size is 0

Hope you can help.

Best regards,

Lolo



	

--
View this message in context: http://cxf.547215.n5.nabble.com/Prob-uploading-file-with-pics-tp5160008p5160008.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Prob uploading file with pics

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

Redirecting to the users list,

On 20/01/12 10:43, lolo13100 wrote:
> Hi !
>
> I've a strange problem with the uploading file with pics.
>
> When I uplaod a simple RTF file the content of the file is ok. But when I
> insert the same file with a simple pics inside the content of the file is
> empty.
>
> Please find my interface :
> @POST
> @Consumes("multipart/form-data")
> public Response sendFaxPost(MultipartBody attachment) throws Exception {
>
> // presumes the part has a content id
> Attachment a = attachment.getAttachment("FXS_ATTACHMENT");
> InputStream rtf = a.getDataHandler().getInputStream();
> //write file to filesystem
> ....}
>
> First case (simple RTF): file is ok
> Second case (same RTF with simple jpg inside ): file size is 0

Can you capture somehow the payload in the 2nd case, without the actual 
data within the parts but for me to see the way the payload is 
structured and how the headers look like ?
For example, add a LoggingInInterceptor or use a tcp trace utility.

Cheers, Sergey
>
> Hope you can help.
>
> Best regards,
>
> Lolo
>
>
>
> 	
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Prob-uploading-file-with-pics-tp5160008p5160008.html
> Sent from the cxf-dev mailing list archive at Nabble.com.


-- 
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com