Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

large file uploads with jersey client

866831Oct 28 2011 — edited Oct 28 2011
Hello All,

I am getting heap spcace iissue while uploading large files via jersey client , the jvm will run out memory
Can any one help me in understanding how can i send large file about 300mb
via jersy client.

code that i have wriiten is:

WebResource webResource = client.resource(url);

MultiPart multiPart = new MultiPart();

FileDataBodyPart filePart = new FileDataBodyPart("file", file,
MediaType.APPLICATION_OCTET_STREAM_TYPE);

multiPart.bodyPart(filePart);
multiPart.bodyPart(new FormDataBodyPart("code", code));
ClientResponse response = webResource.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class,
multiPart);


Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2011
Added on Oct 28 2011
2 comments
1,609 views