Pause, resume, Cancel download using NSURLSession UploadTask

I am developing an application to upload multiple files using NSURLSession, now my files have been successfully uploaded. But now I want to pause, resume and cancel the download in the same way as we do in the download tasks. Is it possible.? Any help would be greatly appreciated. Thnx

+8
ios objective-c ios7 nsurlsession nsurlsessionuploadtask
source share
1 answer

I learned a lot, but could not find anything. After I tried this in my code, considering it a download task, I found out that we can โ€œpause, resumeโ€ download tasks using NSURLSession, only we do this when loading tasks.

To pause a task, just call [yourUploadTask suspend]; to resume [yourUploadTask resume]; To cancel [yourUploadTask cancel];

This might help someone working on uploadTask using NSURLSession.

+5
source share

All Articles