ASIHTTPRequest has easy-to-use support for resuming downloads:
http://allseeing-i.com/ASIHTTPRequest/How-to-use#resume
Alternatively, find out how much data you have already downloaded by looking at the size of the existing data and set the Range header to NSMutableURLRequest :
[request addValue:@"bytes=x-" forHTTPHeaderField:@"Range"];
.. where x is the size in bytes of data that you already have. This will load data starting at byte x. You can then add this data to your file as it is received.
Note that the web server you are loading must support partial loading for the resource you are trying to load - if it sends an Accept-Ranges header. Normally, you cannot resume loading dynamically generated content (for example, the page generated by a script on the server).
source share