Return-Path: Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@www.apache.org Received: (qmail 12240 invoked from network); 24 Sep 2003 21:59:05 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Sep 2003 21:59:05 -0000 Received: (qmail 51181 invoked by uid 500); 24 Sep 2003 21:58:51 -0000 Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@jakarta.apache.org Received: (qmail 51161 invoked by uid 500); 24 Sep 2003 21:58:50 -0000 Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Commons HttpClient Project" Reply-To: "Commons HttpClient Project" Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 51148 invoked from network); 24 Sep 2003 21:58:50 -0000 Received: from unknown (HELO appraisalforum.com) (216.15.152.228) by daedalus.apache.org with SMTP; 24 Sep 2003 21:58:50 -0000 Received: from dalford [24.56.73.122] by appraisalforum.com with ESMTP (SMTPD32-8.02) id A731145E0030; Wed, 24 Sep 2003 18:14:09 -0400 Message-ID: <005401c382e7$266e1270$0300a8c0@dalford> From: "Dan Alford" To: Subject: Problem with multipart post data - Content-Transfer-Encoding: 8bit Date: Wed, 24 Sep 2003 16:59:38 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Declude-Sender: dalford@appraisalforum.com [24.56.73.122] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi all, I have a problem with a multipart post that I am doing to a third party webserver. I am using a MultiPartPostMethod and adding parts to it by the following : Hashtable params = transferObj.getPostParams(); HttpMethod method; if (transferObj.isMultipartForm()) { method = new MultipartPostMethod(transferObj.getTargetURL().toString()); for (Enumeration e = params.elements(); e.hasMoreElements(); ) { Hashtable partParams = (Hashtable) e.nextElement(); String field = (String) partParams.get("fieldName"); if (partParams.containsKey("isFile")) { //file part byte[] data = ( (ByteArrayOutputStream) partParams.get(CONTENT_VALUE)). toByteArray(); String name = (String) partParams.get("fileName"); String encoding = (String) partParams.get(CONTENT_ENC); ByteArrayPartSource part = new ByteArrayPartSource(name, data); FilePart filePart = new FilePart(field, part); ( (MultipartPostMethod) method).addPart(filePart); } else { //string part String data = (String) partParams.get(CONTENT_VALUE); System.out.println("setting "+field+"="+data); StringPart part = new StringPart(field,data); ( (MultipartPostMethod) method).addPart(part); } } This correctly gets me my multipart request which I send to the server. The problem is that the third party server doesnt seem to fully understand the format of the post data. It responds in xml with part of the encoding information still there, for example: when the data supplied as the field parameter above is "AB-031717-01693-1" and the XML response should be I am using the latest rc ( httpclient 2.0-rc1). I have two questions: Firstly, is this a bug or a problem with the target server? secondly, if it is a problem with the target server, how can I disable the output of the Content-Transfer-Encoding part of the multipart data? Thanks in advance, Dan Alford --- [This E-mail scanned for viruses] --------------------------------------------------------------------- To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org