Re: HTTP Uploading
Re: HTTP Uploading
- Subject: Re: HTTP Uploading
- From: JD Morgan <email@hidden>
- Date: Mon, 25 Jun 2007 11:12:07 -0700
I found that using libcurl to upload files is really really easy:
~~~~~~~~SNIP~~~~~~
curl_global_init(CURL_GLOBAL_WIN32);
CURL *ch = curl_easy_init()
CURLcode success;
FILE *aFile = NULL;
aFile = fopen([file cString], "r");
curl_easy_setopt(ch, CURLOPT_URL, "http://hostname/filename");
curl_easy_setopt(ch, CURLOPT_INFILE, aFile);
curl_easy_setopt(ch, CURLOPT_UPLOAD, TRUE);
success = curl_easy_perform(ch);
fclose(aFile);
curl_easy_reset(ch);
~~~~~~~~~SNIP~~~~~~
http://curl.haxx.se/
Hope this helps,
JD Morgan
On Jun 24, 2007, at 6:01 PM, Carter R. Harrison wrote:
This was sort of asked once before but there was never a clear
answer.. so here goes again.
I have some data that I need to upload to a web server via an HTTP
POST method. Doing GET's and downloads is very easy with Cocoa's
URL Loading System, but it's not clearly outlined how to do file
uploads. Can somebody point me in the right direction on how to do
this?
Many thanks.
-Carter
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >HTTP Uploading (From: "Carter R. Harrison" <email@hidden>) |