hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Gl├╝ck <ortwin.glu...@nose.ch>
Subject Re: File Upload
Date Thu, 13 Feb 2003 09:10:37 GMT
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.



p.s. I will re-TAB the samples in a minute as they look ugly.

View raw message