AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSString *imagePostUrl = [NSString stringWithFormat:@"www.abc.com?"];
NSDictionary *parameters = @{@"device_id":string,@"device_phone":[[NSUserDefaults standardUserDefaults] objectForKey:@"SerialNumber"]};
NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:imagePostUrl parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData appendPartWithFileData:data name:@"uploaded_file" fileName:ext mimeType:@"image/jpeg"];
}];
AFHTTPRequestOperation *op = [manager HTTPRequestOperationWithRequest:request success: ^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"response: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
op.responseSerializer = [AFHTTPResponseSerializer serializer];
[[NSOperationQueue mainQueue] addOperation:op];
I am getting images from image in images path in mobile , I am sending all the images with parameters to the server. Here sending images are one by one with parameters to the server hoe can i send this . How can I achieve this? Please help me. Thanks in advance.