Re: HTTP Uploading
Re: HTTP Uploading
- Subject: Re: HTTP Uploading
- From: Dave Dribin <email@hidden>
- Date: Mon, 25 Jun 2007 13:15:47 -0500
On Jun 24, 2007, at 8: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?
First off, you should probably post networking questions on the
macnetworkprog list:
<http://lists.apple.com/mailman/listinfo/macnetworkprog>
Personally, I'd use libcurl. I spent a lot of time messing around
with NSURLConnection and uploads, and it has some serious limitations
if you're doing multipart POST upload:
* Must build multipart post body yourself using NSData.
* Building the body requires it must live entirely in memory (bad for
large files), or use of a temporary file.
* Does not support the "Expect 100-Continue" header (bad for basic-
auth protected uploads).
* No delegate for upload status to use as a progress indicator.
I've got an Obj-C wrapper around libcurl you may want to look into:
<http://ddribin.googlecode.com/svn/trunk/ddcurl/>
It's still a work in progress, but I'm using it right now for
multipart POST uploads on a client project.
If you *do* want to use NSURLConnection, take a look at another
project I started:
<http://ddribin.googlecode.com/svn/trunk/nsurl/>
This was going to be a project to help use NSURLConnection for stuff
like uploads and authentication, but I'm giving up on it for ddcurl,
instead. The code may be helpful, though.
-Dave
_______________________________________________
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>) |