Hello, Thank you for your quick reply.
This is indeed a solution but I'm afraid it won't solve my problem (sorry, I wasn't very specific in my issue). Unfortunately I don't have access to the inputStream, I can only expose the outputstream (as a WritableByteChannel) to the other application because the writing is provided by it. If I use the HttpEntity interface then I have to modify that application to implement HttpEntity ... which is not possible ... Thank you anyway. Best regards, Emil P.S. I'm trying to implement a some kind of "HttpContentWriter" module in a ECM framework where all the content of documents (e.g. files) will be uploaded on a storage device using HTTP protocol. On Mon, May 21, 2012 at 4:12 PM, Mark Claassen <[email protected]> wrote: > It is pretty easy to make your own HttpEntity. There are just a few > methods. You can just implement this interface to wrap > whatever object you are dealing with. Then in the writeTo method, you can > read from your stream and write it out right away. > > -----Original Message----- > From: Emilian Utma [mailto:[email protected]] > Sent: Monday, May 21, 2012 8:55 AM > To: [email protected] > Subject: HttpClient API - upload files using OutputStream not Filepart > > Hello, > > I want to know if is possible to upload a file which its content is set > via a java.io.OutputStream (as in "old times" when using > java.net.HttpURLConnection) not > org.apache.commons.httpclient.methods.multipart.FilePart.Filepart. > > I need this behaviour because the content is provided by another > application not mine. To save the content in a "temp" zone is not > an option because it is possible to receive hundreds of files per seconds > ... and this will require a "big temp". > > Thank you in advance. > > Best regards, > Emil > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
