I do not think it is a good idea but I will answer your question to let you decide yourself.
AFAIK there are only two ways to send 100 images with a single request:
- Bind them in a single file, for example zip them
- Use multipart/form-data
First approach is quite obvious :) Let's talk about the second one.
Create a multipart request with AFNetworking:
NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer]
multipartFormRequestWithMethod:@"POST"
URLString:[url absoluteString]
parameters:nil
constructingBodyWithBlock:^(id<AFMultipartFormData> formData)
{
for (NSURL *imageUrl in imageURLsArray)
[formData appendPartWithFileURL:imageUrl name:[imageUrl lastPathComponent] error:nil];
}
error:nil];
Save request body to a file because background uploading is supported only for files, not for streams or data in a memory:
NSURL *fileURL = create url for a temporary file
[[AFHTTPRequestSerializer serializer]
requestWithMultipartFormRequest:request
writingStreamContentsToFile:fileURL
completionHandler:(void (^)(NSError *error))
{
NSMutableURLRequest *newRequest = [request mutableCopy];
newRequest.HTTPBodyStream = nil;
// Here you can start background uploading of file fileURL using newRequest request
}];
How to upload a file in background you can find for example here AFNetworking 2.0 and background transfers or here http://www.objc.io/issue-5/multitasking.html