Java Multipart file upload

I am attempting to write a code which will upload a file in parts using a POST request. With every part, I need to send following lines in the POST body,

FILENAME: xxx
LENGTH:  xxx
MD5:  xxx
SESSIONID: xxx
PARTS:x

===PART:x===
<part of the file here>
===END:md5 checksum===

After sending a part, I have to wait for a 202 response and then send the next part.

Any ideas on how to do this?
neerhajnjoshiAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
(Your can use Apache HttpClient's multipart)
0
 
CEHJCommented:
Two ways basically:

a. get that info before you construct the request and add it as post params
b. subclass the request itself
0
 
objectsConnect With a Mentor Commented:
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
neerhajnjoshiAuthor Commented:
@CEHJ,

how do I wait for a response before sending out next part ?
0
 
objectsCommented:
what are you using to send the request?  Once yo have sent the request you need to read the request (which will include the 202 response code which you need to read, don't just assume it there)
0
 
objectsCommented:
0
 
neerhajnjoshiAuthor Commented:
I am aware how to send simple POST/GET requests.  It would be great if anyone could post a sample of multipart post request.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.