• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: HTTP Uploading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: HTTP Uploading
      • From: Nick Zitzmann <email@hidden>
References: 
 >HTTP Uploading (From: "Carter R. Harrison" <email@hidden>)

  • Prev by Date: Re: Plugins and shared code question.,
  • Next by Date: [OT] Don't draw every 10th sample(!) (Was Re: Best drawing technology for audio waveforms, envelopes, etc.?)
  • Previous by thread: HTTP Uploading
  • Next by thread: Re: HTTP Uploading
  • Index(es):
    • Date
    • Thread