File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Uploading multiple files via HttpClient Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Uploading multiple files via HttpClient" Watch "Uploading multiple files via HttpClient" New topic
Author

Uploading multiple files via HttpClient

Dan King
Ranch Hand

Joined: Mar 18, 2009
Posts: 84
I'm trying to put together code that can upload multiple files to a server via HTTP. So far, I've put together code that can send one file at at time via HTTP. When I send more than one file at a time the first file is processed but then the app hangs - there are no java errors.

My hunch is the problem is caused by the boundaries of the HTTP parts.
Can anyone tell me:
1. If my hunch is correct, and if not what the actual problem is.
2. How to resolve the problem.

Below is the code I'm using to create the request entity:



Following is the request entity header info:

--3D6atZKLBPujpCZzClN-wz3AJ0Eh-BBWlRr
Content-Disposition: form-data; name="imgFile[]"; filename="Inbox_Msg_Display.GIF"
Content-Type: application/octet-stream; charset=ISO-8859-1
Content-Transfer-Encoding: binary
--3D6atZKLBPujpCZzClN-wz3AJ0Eh-BBWlRr--

--A2cG-IXHLNC2Rk7kF3fQ5-bQPQpuDwmUU
Content-Disposition: form-data; name="imgFile[]"; filename="Table_Msg_Content.GIF"
Content-Type: application/octet-stream; charset=ISO-8859-1
Content-Transfer-Encoding: binary
--A2cG-IXHLNC2Rk7kF3fQ5-bQPQpuDwmUU--


Thanks!

-Dan




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploading multiple files via HttpClient