ASI's Breakpoint Download technology is very easy to use, any application that has the download function can try:
1. Create the Request object nsurl *url=[nsurl urlwithstring:@ "Enter your download link here"]; ASIHTTPRequest *request=[asihttprequest Requestwithurl:url]; 2. Set the path to save the downloaded file nsstring *cachepath=[nssearchpathfordirectoriesindomains (nsdocumentdirectory, Nsuserdomainmask, YES) lastobject]; NSString *filename=[cachepath stringbyappendingpathcomponent:@ "Video.zip"]; Request.downloaddestinationpath=filename; NSLog (@ "%@", filename); 3. Set the agent request.downloadprogressdelegate=self.progress for download progress;// Don't forget to sign the agent here <ASIProgressDelegate> // 4. Send network request (async) [request startasynchronous]; 5. Breakpoint Download: request.allowresumeforfiledownloads=yes; 6. After downloading, notify [Request setcompletionblock:^{ NSLog (@ "file has been downloaded"); }];
To cancel the download method:
[Request Cleardelegatesandcancel];
iOS ASI breakpoint Download