Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 37219 invoked from network); 3 Jan 2011 17:59:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jan 2011 17:59:46 -0000 Received: (qmail 16957 invoked by uid 500); 3 Jan 2011 17:59:42 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 16873 invoked by uid 500); 3 Jan 2011 17:59:42 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 16864 invoked by uid 99); 3 Jan 2011 17:59:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jan 2011 17:59:42 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [76.96.62.80] (HELO qmta08.westchester.pa.mail.comcast.net) (76.96.62.80) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jan 2011 17:59:35 +0000 Received: from omta19.westchester.pa.mail.comcast.net ([76.96.62.98]) by qmta08.westchester.pa.mail.comcast.net with comcast id r0hc1f00327AodY585zFhm; Mon, 03 Jan 2011 17:59:15 +0000 Received: from [192.168.1.106] ([67.165.36.247]) by omta19.westchester.pa.mail.comcast.net with comcast id r5zF1f0035KwAYb3f5zFvL; Mon, 03 Jan 2011 17:59:15 +0000 Message-ID: <4D220E71.3000806@christopherschultz.net> Date: Mon, 03 Jan 2011 12:59:13 -0500 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: multipart/form-data support References: In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pankaj, On 1/2/2011 10:06 PM, Pankaj Tiwari wrote: > I have been trying to send multipart/form-data to the server. I have found > that the request never reaches the server. How are you checking to see if it reaches the server? > This is my client code, if I am missing something core in here. > > public static void main(String args[]) > { > try > { > URL url = new URL(SERVERURL); What is SERVERURL? > con.setDoInput(true); > con.setDoOutput(true); ... > OutputStream out = con.getOutputStream(); > DataOutputStream oos = new DataOutputStream(out); I agree with Pid: why are you using DataOutputStream? > oos.writeBytes(TWOHYPHENS + BOUNDARY + LINEEND); Hmm... write before connect? > oos.flush(); > con.connect(); Try connecting before writing. Also, try reading the response (you did setDoInput(true)...). - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0iDnEACgkQ9CaO5/Lv0PD6AQCfctFc2yULc7QkATMx1fAqwe5F km4AniigJu80/uJ6gl1Kg/6WD1i+rv/I =KmrY -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org