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 7811851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:18:59+00:00 2026-06-02T04:18:59+00:00

I’m developing client-server app. I found few tutorials how to upload one image. But

  • 0

I’m developing client-server app. I found few tutorials how to upload one image. But what the best way to upload several images using single request? I’m new in web programming so I don’t no the common way.

Any help appreciated.

  • 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-02T04:19:00+00:00Added an answer on June 2, 2026 at 4:19 am

    You should to use ASIHTTPRequest library.

    Then create your own class to manage all request you want. This is mine:

    #import "ASIFormDataRequest.h"
    
    @interface PostRequest : NSObject {
        id localCopy; // to avoid exec_bad_access with arc
        ASIHTTPRequest *getRequest;
        ASIFormDataRequest *postRequest;
    }
    
    @property (nonatomic, retain) id delegate;
    @property (nonatomic, readwrite) SEL callback;
    @property (nonatomic, readwrite) SEL errorCallback;
    
    - (void)performGetRequestWithString:(NSString *)string stringDictionary:(NSDictionary *)stringDictionary delegate:(id)requestDelegate requestSelector:(SEL)requestSelector errorSelector:(SEL)errorSelector;
    - (void)performPostRequestWithString:(NSString *)string stringDictionary:(NSDictionary *)stringDictionary dataDictionary:(NSDictionary *)dataDictionary delegate:(id)requestDelegate requestSelector:(SEL)requestSelector errorSelector:(SEL)errorSelector;
    
    @end
    

    //

    #import "PostRequest.h"
    
    @implementation PostRequest
    
    @synthesize delegate;
    @synthesize callback, errorCallback;
    
    - (void)performGetRequestWithString:(NSString *)string stringDictionary:(NSDictionary *)stringDictionary delegate:(id)requestDelegate requestSelector:(SEL)requestSelector errorSelector:(SEL)errorSelector {
    
        localCopy = self;
    
        self.delegate = requestDelegate;
        self.callback = requestSelector;
        self.errorCallback = errorSelector;
    
        NSMutableString *requestStringData = [[NSMutableString alloc] init];
        if (stringDictionary)
            for (NSString *key in [stringDictionary allKeys])
                [requestStringData appendFormat:@"%@=%@&", key, [stringDictionary objectForKey:key]];
        NSString *resultString = [requestStringData substringToIndex:[requestStringData length]-1];
    
        getRequest = [[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?%@", string, [resultString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]];
        [getRequest setDelegate:self];
        [getRequest setRequestMethod:@"GET"];
    
        //NSLog(@"request url = %@", [getRequest.url absoluteString]);
        [getRequest startAsynchronous];
    }
    
    - (void)performPostRequestWithString:(NSString *)string stringDictionary:(NSDictionary *)stringDictionary dataDictionary:(NSDictionary *)dataDictionary delegate:(id)requestDelegate requestSelector:(SEL)requestSelector errorSelector:(SEL)errorSelector {
    
        localCopy = self;
    
        self.delegate = requestDelegate;
        self.callback = requestSelector;
        self.errorCallback = errorSelector;
    
        NSURL *url = [NSURL URLWithString:string];
    
        postRequest = [[ASIFormDataRequest alloc] initWithURL:url];
        [postRequest setDelegate:self];
        [postRequest setRequestMethod:@"POST"];
    
        if (stringDictionary)
            for (NSString *key in [stringDictionary allKeys])
                [postRequest setPostValue:[stringDictionary objectForKey:key] forKey:key];
    
        if (dataDictionary)
            for (NSString *key in [dataDictionary allKeys])
                [postRequest setData:[dataDictionary objectForKey:key] forKey:key];
    
        //NSLog(@"request url = %@", [postRequest.url absoluteString]);
        [postRequest startAsynchronous];
    }
    
    #pragma mark - ASIHTTPRequest Delegate Implementation
    
    - (void)requestFinished:(ASIHTTPRequest *)crequest {
        NSString *status = [crequest responseString];
    
        if (self.delegate && self.callback) {
            if([self.delegate respondsToSelector:self.callback])
                [self.delegate performSelectorOnMainThread:self.callback withObject:status waitUntilDone:YES];
            else
                NSLog(@"No response from delegate");
        }
        localCopy = nil;
    }
    - (void)requestFailed:(ASIHTTPRequest *)crequest {
        if (self.delegate && self.errorCallback) {
            if([self.delegate respondsToSelector:self.errorCallback])
                [self.delegate performSelectorOnMainThread:self.errorCallback withObject:crequest.error waitUntilDone:YES];
            else
                NSLog(@"No response from delegate");
        }
        localCopy = nil;
    }
    
    @end
    

    To use it, just import PostRequest.h in your UIViewController and do smth like:

    [requestManager performGetRequestWithString:tempString stringDictionary:stringDictionary dataDictionary:dataDictionary delegate:self requestSelector:@selector(requestSucceeded:) errorSelector:@selector(requestFailed:)];
    

    Parameters:

    • (NSString *)string – url string, where to post your request;
    • (NSDictionary *)stringDictionary – dictionary, which contains all the text information (such as name, id etc.);
    • (NSDictionary *)dataDictionary – dictionary, which contains all data information (such as photos, files, etc.);
    • (id)requestDelegate – delegate to perform selectors below;
    • (SEL)requestSelector – selector, which will be executed while successfully request;
    • (SEL)errorSelector – selector, which will be executed, while error occurred.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.