| |
|
|
|
cURL Mailing List Monthly Index Single Mail
curl-library Mailing List Archives
File transfer using http post
From: <madhusudhan.nanjappa_at_wipro.com>
Date: Fri, 2 Mar 2007 18:13:32 +0530
Hi,
I am in need of transferring a file to a server using http post. Being new to both http programming and libcurl is a deadly combination I guess. from the sample code available on the libcurl site here I was able to write this code.
#include <stdio.h>
size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
retcode = fread(ptr, size, nmemb, stream);
fprintf(stderr, "*** We read %d bytes from file\n", retcode);
return retcode;
int main(int argc, char **argv)
if(argc < 3)
file= argv[1];
hd_src = fopen(file, "rb");
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
res = curl_easy_perform(curl);
Ethereal packet analysis shows content-length to be zero. Can some one help me out?
Thanks for your time:)
Regards,
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info