cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP POST Memory...

From: Combes, Chris M. <ccombes_at_northropgrumman.com>
Date: Wed, 19 Jun 2002 10:02:43 -0400

Hey SHIRETU,

Try this:

 /* Add a buffer to upload */
 curl_formadd(&post, &last,
              CURLFORM_BUFFER, "data",
              CURLFORM_BUFFERPTR, record,
              CURLFORM_BUFFERLENGTH, record_length,
              CURLFORM_END);

Where "data" is just the name of the field.

Chris

SHIRETU wrote:
>
> oh,
>
> My form NEEDS a valid file (<INPUT TYPE="file" NAME="FileName">).
> I just asked you how to simulate one in memory,
> how to read from a buffer instead from a file(ex: char *, CString, etc).
>
> Let me give you an example:
>
> CString str="This is the content of a file";
>
> When i pass the string str to MyPost(CString URL, CString data_to_be_posted)
> function I want to be interpreted as a binary file (with a generated name if necesary) by cURL
> library. You can say now: "So, write a file with that content and
> pass it to cURL!!!". But I don't want to write anything on HDD because
> of speed problems. Is this possible?
>
> Sorry for bothering you for so many times... [Image]
>
> ----------------------------------------------------------------------------------------------------------------------
> Do You Yahoo!?
> Sign-up for Video Highlights of 2002 FIFA World Cup

----------------------------------------------------------------------------
                   Bringing you mounds of caffeinated joy
>>> http://thinkgeek.com/sf <<<
Received on 2002-06-19