PDA

View Full Version : Download files using iPad Safari. Protocol Plugin?




robj
Jul 7, 2010, 02:22 AM
Hi!

I don't know if you have tested it, but when you want to download a file while you are browsing the web using the iPad's Safari, it shows you somethign like a webpage with a button to download the file using GoodReader.

Other way to do the same is to put a 'g' before the URL of the file you want to download, like in "ghttp://someserver.com/somefile.mp3"

I'm interested in how this work.

Is goodreader installing some kind of "protocol management plugin" in Safari?

How can GoodReader detect I'm downloading a file using Safari as It cannot be running in background?

Is There any way to add a plugin to Safari to intercept file downloads?

Thanks for your help ;)



robbieduncan
Jul 7, 2010, 04:02 AM
Any application can register a URL protocol that it handles with the system. This is covered in the documentation (http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StandardBehaviors/StandardBehaviors.html#//apple_ref/doc/uid/TP40007072-CH4-SW50). I suggest you take some time to read the entirety of the document I have linked to. All iPhone developers should have read it all and be familiar with it before even thinking about writing any code.

robj
Jul 7, 2010, 05:02 AM
Any application can register a URL protocol that it handles with the system. This is covered in the documentation (http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StandardBehaviors/StandardBehaviors.html#//apple_ref/doc/uid/TP40007072-CH4-SW50). I suggest you take some time to read the entirety of the document I have linked to. All iPhone developers should have read it all and be familiar with it before even thinking about writing any code.

Thank you for pointing me to that doc! :)

I love the Apple developer site (and its lovely to read it in the iPad also ;) )

I read this doc long time ago and I couldn't remember that this info was within this doc :)