My application requires downloading video files from the user's phone, which will then be processed on the server. The problem is that the file size can reach 200 MB plus, and the user will not keep the application open to wait for the file to load. Because apple does not allow applications to run in the background for more than a limited time. How can I ensure the download of my files. I am using afnetworking to configure the download task defined by the ios 7 library.
Please, if someone can point me in the right direction or have any solution, we will be very grateful. I've been banging my head about this for too long. Thanks.
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; [manager setTaskDidSendBodyDataBlock:^(NSURLSession *session,NSURLSessionTask *task ,int64_t bytesSent, int64_t totalBytesSent,int64_t totalBytesExpectedToSend){ CGFloat progress = ((CGFloat)totalBytesSent / (CGFloat)sensize); NSLog(@"Uploading files %lld -- > %lld",totalBytesSent,totalBytesExpectedToSend); [self.delegate showingProgress:progress forIndex:ind]; }]; dataTask = [manager uploadTaskWithStreamedRequest:request progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { if (error) { NSLog(@"Error: %@", error); } else { } }];
My request is a regular multi-profile form request.
source share