Note that there are some explanatory texts on larger screens.

plurals
  1. POSending multiple Images to Web server
    primarykey
    data
    text
    <p>I am working in an app, where i need to send 3 images to a Web Server. I don't know the perfect method that works fast and efficient. </p> <p>I have 3 <code>UIImageView</code> that capture image data from camera or photo album. Below,I am using <code>AFNetworking</code> to send 1 image to Web Server. </p> <pre><code>NSString *imgPath = [[NSBundle mainBundle]pathForResource:@"Default" ofType:@"png"]; NSData *imgData = UIImagePNGRepresentation([UIImage imageWithContentsOfFile:imgPath]); NSData *imagVIewData = UIImageJPEGRepresentation(imageView1.image,90); if (imagVIewData) { AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://myurl.com/xxx.php]]; NSMutableURLRequest *myRequest = [client multipartFormRequestWithMethod:@"POST" path:Nil parameters:Nil constructingBodyWithBlock:^(id&lt;AFMultipartFormData&gt; formData) { [formData appendPartWithFileData:imagVIewData name:@"file_upload" fileName:@"123.jpg" mimeType:@"images/jpeg"]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]initWithRequest:myRequest]; [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) { NSLog(@"Sent %lld of %lld bytes",totalBytesWritten,totalBytesExpectedToWrite); }]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(@"upload complete"); } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"%@",operation.responseString); }]; NSOperationQueue *queue = [[NSOperationQueue alloc]init]; [queue addOperation:operation]; } } </code></pre> <p>i need someone advice to send 3 different images from 3 UIImageViews. Is it possible with this program or do i need to work through different methods?</p> <p>any idea?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload