[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    Re: Issue with uploading multiple files using MultipartRequestEntity
From:       Roland Weber <ossfwot () dubioso ! net>
Date:       2008-02-17 17:24:40
Message-ID: 47B86DD8.1010803 () dubioso ! net
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic