how to upload a file using libcurl in c
I am building an application and I want it t开发者_StackOverflow社区o upload a file using http . I am doing this using libcurl. I would like someone to give an example on how to upload a file, either in c using lib curl. Thanks in advance!
See the file upload example in the cURL docs and change the protocol from file
to whatever you want to use: http://curl.haxx.se/libcurl/c/fileupload.html. Note that CURLOPT_UPLOAD
will send a PUT
request when doing HTTP.
Or check out the FTP upload example: http://curl.haxx.se/libcurl/c/ftpupload.html
精彩评论