Return-Path: Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 75608 invoked from network); 13 Feb 2003 09:10:26 -0000 Received: from unknown (HELO nose.ch) (195.134.131.71) by daedalus.apache.org with SMTP; 13 Feb 2003 09:10:26 -0000 Received: (qmail 28346 invoked from network); 13 Feb 2003 10:10:37 -0000 Received: from calvin.nose.ch (HELO nose.ch) (192.168.1.7) by 0 with SMTP; 13 Feb 2003 10:10:37 -0000 Message-ID: <3E4B610D.5070604@nose.ch> Date: Thu, 13 Feb 2003 10:10:37 +0100 From: =?ISO-8859-1?Q?Ortwin_Gl=FCck?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: de-ch, en-us MIME-Version: 1.0 To: Commons HttpClient Project Subject: Re: File Upload References: <7382FCA44E27D411BD4A00508BD68F95053CD842@pigeon.tumbleweed.com> <000f01c2d32c$3f342940$6401a8c0@DJW> In-Reply-To: <000f01c2d32c$3f342940$6401a8c0@DJW> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Daniel Walsh wrote: > I was under the impression, though, that the implementation that you spoke > of would require an HTML form, or some other type of UI - which my > application does not use. Is that not true? No of course not. HttpClient provides all you need to tailor an appropriate POST request. There are two possibilities to upload a file: 1. Use multi-part-MIME. Look at the example MultipartFileUploadApp.java. The part in the ActionListener is what you actually need. On the server side you need to parse the multi-part stuff. Commons FileUpload helps you. 2. Send the plain file as the request body. Look at the example PostXML.java. On the server side you need only the request input stream. That's it. HTH Odi p.s. I will re-TAB the samples in a minute as they look ugly.