iosafnetworkingnsurlsessionnsurlsessiondownloadtasknsurlsessionuploadtask

iOS Multiple file uploading to server using NSURLSessionTask


I'd like to upload lots of files to server. for instance, the user taken images more than 50 when not reachable on network and hit send button. Then i should upload them when reachable on network. iOS doesn't allows to add session task with large size post request when not reachable on network. so i've tried a chained tasks. but it's takes very long time to wakeup next task.


Solution

  • There is no limitation for requests in iOS. You can send data with arbitrary length to a server. But, for large data you should avoid loading the complete data into memory. Instead you should setting HTTPBodyStream in NSMutableURLRequest or a file (e.g. uploadTaskWithRequest:fromFile:completionHandler:).