Issues with Uploading Multiple Photos in Mobile App - Files Are Empty

Let me help you with the implementation for multiple images.

We can set uploadFile as if we already had the data, just define the variables that we'll replace using additionalScope:

For the JS, we need:

  1. Iterate over the value of the Image input component.
  2. Get the base64 data of each image.
  3. Trigger uploadFile passing the right data and name for each file.

Here is the JS:

let images = imageInput1.value

for(let i = 0; i < images.length; i ++){
  let base64Image = await utils.getDataByObjectURL(images[i])
  let encoded = base64Image.split(", ")[0]
  await uploadFile.trigger({
    additionalScope: {
      formattedfile: encoded,
      fileName: textInput1.value + "-" + i
    }
  })
}

The app needs the Image & Text input components, and a button to trigger the JS query:

That should work like a charm: