> 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.
Why would this method need to be limited to a plain text file, doesn't it just send the bytes? Also, I notice that the JavaDoc for the PostMethod's setRequestBody method states: Once this method has been invoked, the request parameters cannot be altered until I am recycled. While the addParameter method states: Throws: java.lang.IllegalStateException - if my request body has already been generated. Is there a way of sending the file name with the file contents? Or, would I need to revert back to sending the file name ahead of time and setting the name to a session attribute to be extracted when the file contents are later received? Thanks for the help, Daniel > 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. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]