Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 85144 invoked from network); 11 Feb 2008 04:19:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2008 04:19:15 -0000 Received: (qmail 1258 invoked by uid 500); 11 Feb 2008 04:19:08 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 1239 invoked by uid 500); 11 Feb 2008 04:19:08 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 1230 invoked by uid 99); 11 Feb 2008 04:19:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Feb 2008 20:19:07 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of madhu741980@gmail.com designates 209.85.132.241 as permitted sender) Received: from [209.85.132.241] (HELO an-out-0708.google.com) (209.85.132.241) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2008 04:18:37 +0000 Received: by an-out-0708.google.com with SMTP id d31so989458and.24 for ; Sun, 10 Feb 2008 20:18:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=1y3mcuEHAD1Y4jA0xxfX9Z8+eKyuNRC4y1BwSdvofJw=; b=uV1x2jsn6vJLv1tGBV4lAbGQ3sF3aWlVUa6ivV61f1frTuWxL7vNgof17m6k3T7VAFiiXuR1/34iKXdYp4DSnw+J8Op/7F9flJhhcVCnod2I3JMPYgKS0SF7HBUGHQWdswGMebRI2ngvbjS727KgpLDGHn9Xg7ysifG/coADrcU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=Ml737E3d6y4iHW1XS61oP7T12baRvJAczzwpInX6PX9zybzqgJwR0bOz0zCnoZkECA7z5piruOLx0qy7G00dyQG1F2LE7qLUYG9SRCIPmWn13kuz9jzZQlabPp7KCOu7KY+HzIEn2nN8sARKnxoZEXaHv0MNfnDb751ujfg/VzE= Received: by 10.100.31.3 with SMTP id e3mr16429241ane.1.1202703524722; Sun, 10 Feb 2008 20:18:44 -0800 (PST) Received: by 10.101.71.3 with HTTP; Sun, 10 Feb 2008 20:18:44 -0800 (PST) Message-ID: <9163ed8b0802102018j42028fc4n79e7c0e058b6b60@mail.gmail.com> Date: Sun, 10 Feb 2008 23:18:44 -0500 From: "madhu nair" To: httpclient-users@hc.apache.org Subject: Issue with uploading multiple files using MultipartRequestEntity MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_31828_33488543.1202703524710" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_31828_33488543.1202703524710 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_31828_33488543.1202703524710--