Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Sometimes we need to upload the multiple images to a server in a single request, for this Alamofire 3.0 provide the upload facility where we can upload ‘n’ number of images in the single request.
For this we have to follow some steps;
1: First we have to fetch all images in a single array and store all UIImage object in the array.
Ex:
var imageDataArray:NSMutableArray = []
2: Now collect all the data which you have to send like params, headers or any data
Note: don’t access the data which is on the main thread, when you are uploading the images to server because upload works on background thread only.
Ex: like fetching the value from UItextfield etc;
3: define header in ViewdidLoad()
4: Now its time to define the method :
Note: a: imageFlagArray -> is bool array to check the array contains UIImage data or not.
b: self.imageDataArray[i] -> it contains UIImage object of Images.
c: self.UPLOAD_URL – > it is base URL where we have to upload.
d: self.headers -> it is header which I have defined in viewdidload method;
Now check the proper params and header field, upload URL then try it.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.