PDA

View Full Version : Downloading Files with WebKit




ldenman
Apr 2, 2006, 01:45 AM
I'm working on a cocoa project in xcode and have implemented a small browser. Does anyone know how to enable downloads?
I'm obviously using the WebKit framework...



caveman_uk
Apr 2, 2006, 01:04 PM
I'm working on a cocoa project in xcode and have implemented a small browser. Does anyone know how to enable downloads?
I'm obviously using the WebKit framework...
If you're using webkit there's nothing special you need to do to enable downloads. How've you got it set up?

ldenman
Apr 2, 2006, 01:22 PM
Basically, i just followed this tutorial:

http://www.macdevcenter.com/pub/a/mac/2004/01/23/webkit.html

caveman_uk
Apr 2, 2006, 03:17 PM
And? What's the problem? Should work fine.

Firstly check all your connections in interface builder.

ldenman
Apr 2, 2006, 03:52 PM
i click a file to download and nothing happens..thats the problem.

caveman_uk
Apr 3, 2006, 02:42 AM
So the browsing webpages part of it is working just not the downloading of files?

ldenman
Apr 3, 2006, 09:06 AM
exactly.
thanks for taking time to help me out.

caveman_uk
Apr 3, 2006, 09:46 AM
Have you tried using spotlight to see if the files are being download anywhere on your disk (rather than where you expect them to go)? If you can't find them then the best bet is to check out the documentation. webViews and webFrames have a ton of optional helper objects (delegates , dataSources etc) and maybe one of those is what you want.

I've used webKit in one of my apps in several places but I generally use it to display content my app creates on the fly internally. I've never actually had to worry about where files got downloaded to.

ldenman
Apr 3, 2006, 10:14 PM
...nothing...

caveman_uk
Apr 4, 2006, 04:10 AM
There are a couple of examples in the Developer tools that might help you in /Developer/Examples/Webkit.

The 'Downloader' example specifically deals with downloading files but doesn't use a webview. The Minibrowser example is just that.

ldenman
Apr 4, 2006, 03:13 PM
WOW! Thats exactly what I need...i'll check into it and see if i can work something out. Thanks.