Re: Problem with WebKit Download Delegate
Re: Problem with WebKit Download Delegate
- Subject: Re: Problem with WebKit Download Delegate
- From: "Joe Goh" <email@hidden>
- Date: Tue, 2 Jan 2007 13:36:28 +0800
On 1/2/07, Dave Batton <email@hidden> wrote:
Unfortunately I'm way over my head, and could really use some sample
code that shows me how to turn a click on a .zip file URL on a web
page displayed by WebKit into a local disk file. But none of the
sample code that I've found, including Apple's MiniBrowser, shows me
how to do this. I've been unsuccessful trying to find it with Google
or on any of the other usual sources.
Hi Dave,
What needs to be done now is to implement a startLoading: method in
your NSURLProtocol subclass. You can find how to do this inside the
PictureBrowser example. This provides the actual data that will be
used to save the file.
In addition, you need to override - (void)download:(NSURLDownload
*)download decideDestinationWithSuggestedFilename:(NSString *)filename
inside your subclass of WebDownload. This is where you'll place your
"Save As..." panel.
I was actually stuck with this exact same problem about a month back
actually, and the docs did help quite abit. Unfortunately, I can't
provide any of my code to you as my backend uses CoreData and is quite
different from what you need to do. :-(
Hope this helps!
Cheers,
Joe
FunkeeMonk Technology - http://www.funkeemonk.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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