hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: Issue with uploading multiple files using MultipartRequestEntity
Date Sun, 17 Feb 2008 17:24:40 GMT
madhu nair wrote:
> Hi,
> Can the MultipartRequestEntity object be used to upload multiple files at a
> time to a url. I seem to have some issues with this. My code works fine for
> a single file but then for the 2nd file the same code fails.

I haven't heard of a problem with that yet, but I'm not sure it
was tried either. Could you be a wee bit more specific about the
"code fails" part? Exception? Error response from the server?
Endless loop? Blocked forever?
Providing a reproducible test case based on our test framework
would raise your chances that a developer will look into it.

cheers,
   Roland


> I am using the
> following classes:-
> PostMethod
> 
> FilePart
> 
> This is how I create the filepart object:-
> 
> part = *new* FilePart("filename." + (i+1), *new*ByteArrayPartSource(attachment.
> attachmentName,attachment.data));
> 
> part.setTransferEncoding(*null*);
> 
> 
> 
> parts.add(part);
> 
> multiParts = parts.toArray(*new* Part[]{});
> 
> attach.setRequestEntity(*new* MultipartRequestEntity(multiParts,
> attach.getParams()));
> 
> code = *httpclient*.executeMethod(attach);
> 
> html = attach.getResponseBodyAsString();
> 
> I have multiple such file parts added to the parts list before passing it to
> the MultipartRequestEntity object. i am not changing the content-type and am
> using the default of "application/octet-stream".
> 
> Can anyone tell me what is wrong or give me the code snippet to upload
> multiple files at a time ?
> 
> Thanks for your help.
> 
> Madhu
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message