Use FileBody in the MultipartEntity.

See MultipartEntity discussion in this post:
http://old.nabble.com/HttpClient-3.1-to-4.0-migration-td25262394.html

On Thu, Jan 21, 2010 at 8:14 AM, nabbler101 <bghorb...@gmail.com> wrote:
>
> Yes I've tried MultipartEntity.  That works fine.  But I want to send two
> text parameters a 3rd parameter as a file.
>
> Lets say A and B are the two text parameters
>
> nvps.add(new BasicNameValuePair("A", "1"));
> nvps.add(new BasicNameValuePair("B", "2"));
>
> But C is a file...a text file at that.
>
> nvps.add(new BasicNameValuePair("C", "big text file"));
>
> Now I know that's not a good idea, but what is the correct way of doing
> this?
>
> Thanks!
>
>
>
> olegk wrote:
>>
>> On Wed, 2010-01-20 at 08:54 -0800, nabbler101 wrote:
>>> So I'm trying to pass a very large string (~15mb) as a parameter using
>>> httppost but I'm getting an OutOfMemoryException.  The heap size is set
>>> to
>>> 512-1024mb (which should be more than enough.)
>>>
>>> Is there a way around this problem?  I'd appreciate any help.
>>>
>>
>> What is the point of buffering 15mb of data in memory? Have you
>> considered NOT buffering content of the file in memory?
>>
>> Oleg
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
>> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/UrlEncodedFormEntity-throws-OutOfMemoryError-exception-tp27244948p27257481.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to