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 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

Reply via email to