Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8999175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:08:43+00:00 2026-06-16T00:08:43+00:00

I am uploading multiple files using AFNetworking. I need to send extra information such

  • 0

I am uploading multiple files using AFNetworking.
I need to send extra information such as image width/height for each image.

I thought I would just loop through images and send them but AFNetworking doesn’t quite handle it.
(I suspect AFNetworking combines multiple requests into one, overwriting extra informations)

Below is my code.

NSURL *url = [NSURL URLWithString:@URL_BASE];
int count = [imageArray count];

for(int i = 0; i < count; ++i)
 {
     UIImage* image = [imageArray objectAtIndex:i];
     AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
     NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:
                                             [NSNumber numberWithFloat: image.size.width], @"width",
                                             [NSNumber numberWithFloat: image.size.height], @"height",
                                          nil];

     NSMutableURLRequest *request = [httpClient multipartFormRequestWithMethod:@"POST" path:@PATH_ALBUM_IMAGE_UPLOAD parameters:params constructingBodyWithBlock: ^(id <AFMultipartFormData>formData) {
             [formData appendPartWithFileData:imageData name:[NSString stringWithFormat:@"file%d", i]  fileName:@"avatar.jpg" mimeyTpe:@"image/jpeg"];
         }];

     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setUploadProgressBlock:^(NSInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {

             [progressView setProgress: totalBytesWritten*1.0f / totalBytesExpectedToWrite animated: YES];
             NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite);
             if(totalBytesWritten >= totalBytesExpectedToWrite)
             {
                 progressView.hidden = YES;
             }
         }];
     [operation start];
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:08:43+00:00Added an answer on June 16, 2026 at 12:08 am

    This turned out to be a known(but now fixed) bug of AFNetworking.

    AFNetworking

    problem solved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to go about uploading Multiple files(i have multiple files inside a folder) using
I am using the tag for uploading multiple files with php. I notice that
I need to provide a way of users uploading multiple files (can be 10MB
I'm uploading multiple files to Amazon S3 using Java. The code I'm using is
I'm uploading files (images) to my file structure using Uploadify, then catching each file,
I am currently working with multiple php image uploading but using this SITE I
I need to upload multiple files into web server using MVC3 with RAZOR. I
I see a ton of questions about uploading multiple files, but none about uploading
i have an issue with uploading multiple files to disk. here is my code.
I have a problem conserning uploading multiple files to my ftp server and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.