nsurlsessionuploadtask

Unable to sustain a Constant Speed while Uploading files in the background with NSURLSession

馋奶兔 提交于 2019-11-28 22:11:32
I am trying to upload some 100 images to S3 in the background with AFURLSessionManager in small batches of 10 like what is being done here- Manage the number of active tasks in a background NSURLSession I am using a shared NSURLSession and adding tasks according more tasks to this when some tasks are completed. Average size of each file is about 1.6 MB and the number of tasks that are guaranteed to run per a task queue is 5 Here is my method for adding the tasks: (also available as an easier-to-read gist ) - (void) addTasksToSessionWithTaskObject:(Task*)taskObject

Upload image from iOS to PHP

不问归期 提交于 2019-11-28 06:48:58
问题 I'm trying to upload an image from my iOS App to my web server via PHP. Here is the following code: -(void)uploadImage { NSData *imageData = UIImageJPEGRepresentation(image, 0.8); //1 NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration]; //2 NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration:config delegate:self delegateQueue:nil]; NSString *urlString = @"http://mywebserver.com/script.php"; NSMutableURLRequest *request = [

Unable to sustain a Constant Speed while Uploading files in the background with NSURLSession

落爺英雄遲暮 提交于 2019-11-27 14:16:48
问题 I am trying to upload some 100 images to S3 in the background with AFURLSessionManager in small batches of 10 like what is being done here- Manage the number of active tasks in a background NSURLSession I am using a shared NSURLSession and adding tasks according more tasks to this when some tasks are completed. Average size of each file is about 1.6 MB and the number of tasks that are guaranteed to run per a task queue is 5 Here is my method for adding the tasks: (also available as an easier

How to get server response data in NSURLSession without completion block

别来无恙 提交于 2019-11-27 06:25:00
I am using NSURLSession for background image uploading. And according to uploaded image my server gives me response and I do change in my app accordingly. But I can't get my server response when my app uploading image in background because there is no completion block. Is there way to get response without using completion block in NSURLUploadTask ? Here is my code : self.uploadTask = [self.session uploadTaskWithRequest:request fromData:body completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { NSString *returnString = [[NSString alloc] initWithData:data encoding

How to get server response data in NSURLSession without completion block

早过忘川 提交于 2019-11-26 11:59:25
问题 I am using NSURLSession for background image uploading. And according to uploaded image my server gives me response and I do change in my app accordingly. But I can\'t get my server response when my app uploading image in background because there is no completion block. Is there way to get response without using completion block in NSURLUploadTask ? Here is my code : self.uploadTask = [self.session uploadTaskWithRequest:request fromData:body completionHandler:^(NSData *data, NSURLResponse