cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Upload Form Data From Buffer

From: Combes, Chris M. <ccombes_at_northropgrumman.com>
Date: Mon, 10 Jun 2002 09:11:00 -0400

No problem on the name changes Daniel.

I can make the interface look as follows:

curl_status = curl_formadd(&post, &last,
                           CURLFORM_COPYNAME, "record",
                           CURLFORM_FILENAME, "data",
                           CURLFORM_PTRFILEBUFFER, record_buffer,
                           CURLFORM_FILEBUFFERLENGTH, size,
                           CURLFORM_END);

I can add test code similar to what exists in curl already.

I will send the diff report soon.

Thanks,
Chris

Daniel Stenberg wrote:
>
> On Fri, 7 Jun 2002, Combes, Chris M. wrote:
>
> > I've been working on a new "formadd" option to libcurl which allows the
> > user to upload data similar to CURLFORM_FILE, but uses an existing buffer
> > as the data source.
>
> I think it is a sane and sound addition. I do have some opinions on some
> minor details though:
>
> > curl_status = curl_formadd(&post, &last,
> > CURLFORM_COPYNAME, "record",
> > CURLFORM_BUFFER, "data",
> > CURLFORM_BUFFERPTR, record_buffer,
> > CURLFORM_BUFFERLENGTH, size,
> > CURLFORM_END);
> >
> > CURLFORM_BUFFER indicates that we want to add data from a buffer, and
> > triggers the addition of the "filename" attribute set to "data".
>
> Couldn't we use the already existing CURLFORM_FILENAME for the file name?
>
> > CURLFORM_BUFFERPTR points to the existing buffer.
> >
> > CURLFORM_BUFFERLENGTH is the size of the buffer.
>
> As these ones would indicate a "file part" buffer, I'd prefer if they had
> names that somehow gave this impression a bit easier. Perhaps
> CURLFORM_PTRFILEBUFFER and CURLFORM_FILEBUFFERLENGTH?
>
> > I ran several tests using ascii and image data with positive results.
>
> Goodie. I wish we had a libcurl test suite we could add something like that
> to... :-/
>
> > This is the first contribution I've made to an open source project so I
> > will need to read up on how to incorporate the changes via SourceForge.
>
> No need to do that just now, actually (even though getting to know how is
> never bad of course). It'll be good enough if you just can provide us with
> the output from 'diff -ru orig-curl-tree your-modified-curl-tree'. That's
> what most of us call "a patch". ;-)
>
> --
> Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

-- 
Christopher M. Combes, Software Engineer 
Northrop Grumman IT
ccombes_at_northopgrumman.com
Newport News, VA 23602 (757) 249-1234
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
Received on 2002-06-10