cURL / Mailing Lists / curl-library / Single Mail

curl-library

OpCurl and curl_formadd

From: Nico Alberti <n8_at_langhirano.it>
Date: Tue, 19 Nov 2002 12:28:46 +0100

Hi everybody. I hope I am not too off topic asking here about the OpCurl
libcurl wrapper for Delphi.

I managed to use OpCurl without any hassle until I had to emulate a form
POST with a file upload. I looked at the curl_formadd function and I
followed the example I found in
http://curl.haxx.se/lxr/source/docs/examples/postit2.c but I did not
manage how to deal with the Pascal implementation of curl_formadd. While
in C you can use it this way:

*//* Fill in the file upload field */
/*curl_formadd <http://curl.haxx.se/lxr/ident?i=curl_formadd>(&formpost,
             &lastptr,
             CURLFORM_COPYNAME, /"sendfile"/,
             CURLFORM_FILE, /"postit2.c"/,
             CURLFORM_END);

In the OpCurl library the function is defined like:

function curl_formadd( httppost: ppHttpPost; last_post: ppHttpPost;
   Opt1: tCURLformoption; Val1: LongInt;
   Opt2: tCURLformoption; Val2: LongInt;
   [...]
   Opt5: tCURLformoption; Val5: LongInt;
   Option_End: tCURLformoption

I am neither a Delphi nor a C expert so I don't know what kind of
LongInts the Delphi function needs instead of the strings.Should I have
to pass the address of a Pchar? I tried with no success, pphttpost and
pplastpost are still nil after I called the function, but perhaps there
is something else I am missing.

Any help would be greatly appreciated. Thanks in advance..

--
Ciao
Nico
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
Received on 2002-11-19