Tutorial :iPhone Download application


I want to ask you whether it is simple to download data from URLs engind such as .php etc. or not. Downloading from direct urls, such as this one http://www.rarlab.com/rar/wrar380.exe is really simple using NSURLConnection. But if I use NSURLConnection on servers like rapidshare.com, or download.cnet.com etc. it is not working. I know why, because it is downloading content of URL and content of URL on this page is a web page. So my question is, is it possible to redirect to file URL on this servers, and if it is, could you give me a direction where to learn it or something like that? I really don't need solution, but I haven't a clue how to solve it. Only thing I know is that on web pages this is done by using some headers, but I don't know PHP. Thanks for replies.


Server's like download.cnet.com will redirect the user to a mirror closer to them. You have to allow redirects with you NRURLConnection.

See http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html#//apple_ref/doc/uid/20001836-160106

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »