hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emilian Utma <utma.emil...@gmail.com>
Subject Re: HttpClient API - upload files using OutputStream not Filepart
Date Mon, 21 May 2012 14:13:50 GMT
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 <mac01@donnell.com> 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:utma.emilian@gmail.com]
> Sent: Monday, May 21, 2012 8:55 AM
> To: httpclient-users@hc.apache.org
> 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: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message