cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

libcurl and curl_formparse (fwd)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 21 Apr 2001 16:53:27 +0200 (MET DST)

This came to me privately. Reply will follow as soon as I get time...

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
---------- Forwarded message ----------
Date: Sat, 21 Apr 2001 01:13:38 -0700
From: Andrej Andrejko
To: daniel_at_haxx.se
Subject: libcurl and curl_formparse
Hi.
I am having trouble with your libcurl.  I wish to transfer a file using and HTTP POST file upload.
Here is my code:
  HttpPost post;
  HttpPost last;
  HttpPost* ppost = &post;
  HttpPost* plast = &last;
  memset(ppost,0,sizeof(HttpPost));
  curl_formparse("userfile=@/tmp/karte.jpg",&ppost,&plast);
  curl_easy_setopt(curl, CURLOPT_URL, turl);
  //curl_easy_setopt(curl, CURLOPT_INFILE, inf);
  //curl_easy_setopt(curl, CURLOPT_PUT, 1);
  curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
  curl_easy_setopt(curl, CURLOPT_POST, 1);
  curl_easy_setopt(curl, CURLOPT_HTTPPOST, &last);
  //curl_easy_setopt(curl, CURLOPT_POSTFIELDS, curl_escape(bm,thumb->filesize + strlen(label)));
  //curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, thumb->filesize + strlen(label));
  curl_easy_setopt(curl, CURLOPT_INFILESIZE, thumb->filesize);
  curl_easy_perform(curl);
The last line crashes.
How do I call curl_formparse correctly?
Thanks,
Andrej
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-04-21

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET