I used the PickerController
and loaded a few images on to a NSMutableArray
.
Now i need to upload all of these images at once. am using
If you want to upload multiple images and you want to keep the parameter name same for all the images you do it as below :
NSDictionary *parameters = @{@"user_key": @"*****"};
NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:queryStringss parameters:parameters constructingBodyWithBlock:^(id formData) {
NSError *error;
[formData appendPartWithFileData:imageData name:@"photo_file[0]" fileName:@"Picture44.png" mimeType:@"image/png"];
[formData appendPartWithFileData:imageData1 name:@"photo_file[1]" fileName:@"Picture45.png" mimeType:@"image/png"];
} error:nil];
In this way the files would be sent as array to the server.