views:

39

answers:

2

Hi,

i am downloading content from server to my app. i am using NSUrlConnection to that in response i am getting data and i am storing that. But if user quits the app while downloading when he launches app next time i have to resume that download from where it stop(download remaining part). how to support this ... is any idea on how to handle this ....

Thanks in advance.

A: 

HI. You need to read and understand complete class reference of NSURLDownload which will be helpful for you.In NSRULDownload class please findout Resuming Partial Downloads methods.

RRB
thanks Rajendra.... but NSURLDownload is not there in iPhone sdk it is only to mac..
jeeva
RRB
+1  A: 

Not pretty sure about how to get the implementation but i can suggest a design for the same. When the connection gets the response in connectionDidReceiveResponse method, you can store the total content length. Once the app is quit, the received data length can be stored in a plist for further reference.

Once the user resumes the application, there is a range request which can be specified in the headers of your request to get the file download from that point. Thats pretty much like downloading from the point where you started it.

This is actually a good idea. I think i shall work on it and get back to you.

Nareshkumar