I want to upload and download big files to or from the server from an iOS app in the following conditions.
1) If my app goes into the background it should perform its uploading and downloading.
2) If I lost the connection then it should stop any progressive upload and download, and then can resume back from where it stopped.
3) If I close the app from the tray then it will follow the same in 2nd point when app restarts.
I really want to know is this possible with NSURLConnection
?
I am very well aware of ASIHttpRequest and AFNetworking libraries, I don't want to use any external libraries instead want to use default NSURLConnection
class for the same.
I am able to download and upload with
NSURLConnection
if its connection is persistent and application running in the background.
I've the following thought in my mind for the 3rd case:
If app will going to terminate then, I'll need to store uploading or downloading progress somewhere so that next time I'll need to send "Range" for the continue download.
But I am not sure how it will handle by server it self? How to configure the server for this? How to configure webservice for this? Any ideas?