Re: How to download a file from a web site?
Re: How to download a file from a web site?
- Subject: Re: How to download a file from a web site?
- From: j o a r <email@hidden>
- Date: Tue, 1 Apr 2003 15:24:34 +0200
On Tuesday, Apr 1, 2003, at 15:17 Europe/Stockholm, Lorenzo Puleo wrote:
I have already found the CURLHandle at the Apple Developer Site.
Then I went to http://curlhandle.sourceforge.net/ and download the
file.
I supposed it was a Carbon API, so my Project Builder should show it,
so I wasn't able to find it :-)
Anyway, first I want to understand the basic rules using your code,
then I will affoard CURLHandle.
Afford? It's free, and open source! But sure, use NSURLHandle until you
have come to terms with the whole concept.
I made some fix to your code, I tell you just in case:
it's URLWithString and not urlWithString
it's addClient and not setClient
I just hacked together an example in Mail and didn't bother to compile
it before I sent it to you, I'm sorry about those errors.
But PB won't compile.
MyObject.m:85: warning: class `MyObject' does not implement the
`NSURLHandleClient' protocol
The client needs to implement all methods found in that protocol or
else you'll get these warnings. Look here for more info:
<
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/Foundation/
ObjC_classic/Protocols/NSURLHandleClient.html>
Btw: This is a good place to search for info from Apple:
<
http://developer.apple.com/search/search.html>
Also I cannot guess where my file should be downloaded. How should
define the destination?
You don't - it will be handed over to you as NSData in the
"URLHandleResourceDidFinishLoading:" method.
And to read a file without saving it to the disk?
You get that for free...
j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.