Uploading multiple files in a single request

So basically I’m trying to be able to upload anywhere from 1-4 images in a single execution, and wondering what the most efficient way to do so would be. I don’t think, running for example 4 cURL operations to upload each file is the best approach.

How would you expect it to work with single request?

Since I send base64 data of the images, I use an array that holds “file”, and in that it has the image as base64, the content type and image name. I then pass this into POSTFIELDS for the cURL request. Basically what I’m wondering is, if I have an upload form that allows for multiple files, I get all the base64’s for the files and other data like name and content type, is there a way to add it all to POSTFIELDS and send it all in one request, or does the API only allow for a single-file upload?

In that case I would have to loop the cURL request and make 4 different POST requests for the 4 seperate files even though they’re all sent through from a single form post

This topic was automatically closed after 15 days. New replies are no longer allowed.