Send Multiple Uploaded Files using API Connector (Multipart/form-data)

Hey everyone,

I want to use the API Connector to initiate form-data calls to upload an array of files using a 3rd party API endpoint. The 3rd party endpoint accepts uploading multiple files as an array of files.

How can I set up the ‘files’ parameter in the API Connecter to accept a list of files instead of one file only? (screenshot attached).

1 Like

You would need to first check the API provider documentation on the format they accept and then format the value portion of the parameter to use that format…usually this would be JSON format, and the values to use in the JSON for the file would be the file URL.

1 Like

If they accept it as an “array of files” then you just need to send a list of links of those files.

No need to select body type as Form-data, set it as JSON

Then the files parameter should be a list of links to those files, which can be fetched as Do a Search for files 's each items URL

That should do it, if not, feel free to link to their API docs.

Thank you both. The external API accepts a list of PDF files. It does not support file URLs.

When I am uploading one file only using Bubble’s multi-file uploader it works but it returns the error below when I am uploading multiple files. I suspect that this has something to do with how the API endpoint is set up in the API Connector.

Screenshot 2023-10-07 at 1.15.07 AM

Appreciate your help.

Link us the API docs

@ayman3

Hi, @tylerboodman @rohanjainneri

I’ve been trying to do this with this API but have not been able to send these files:

file 1:

https://3d0029e11db89e3eedba2c004b65b130.cdn.bubble.io/f1719347532568x256673259015105500/ElevenLabs_2024-06-25T20_32_03_Arnold_pre_s50_sb75_t2.mp3?_gl=1*1sajzym*_gcl_au*Nzk2MjQ0MDE2LjE3MTM5ODYxOTI.*_ga*MTE0MjEzNDU2Mi4xNjk0NzI0MDMz*_ga_BFPVR2DEE2*MTcxOTQxNDMyMS4xMDIuMS4xNzE5NDM0NjQyLjYwLjAuMA

file 2:

https://3d0029e11db89e3eedba2c004b65b130.cdn.bubble.io/f1719347555770x472259243178151600/ElevenLabs_2024-06-25T20_32_25_Domi_pre_s50_sb75_t2.mp3?_gl=1*n7thz9*_gcl_au*Nzk2MjQ0MDE2LjE3MTM5ODYxOTI.*_ga*MTE0MjEzNDU2Mi4xNjk0NzI0MDMz*_ga_BFPVR2DEE2*MTcxOTQxNDMyMS4xMDIuMS4xNzE5NDM0NDI0LjQ1LjAuMA

Would you take a look to see if you can make it work?
Or anybody else.

Thank you

1 Like

Hi @pachocastillosr and @ayman3 !

I ran into the same problem this week. I’m no expert (yet :slight_smile:) but I think I found a decent workaround. Works for me as long as no one comes up with a better solution…

I’ve been trying to POST a list of files (images in my case) as well. Seems like this doesn’t work with a single parameter set up in the API Connector. Haven’t found a way to have a single parameter accept a list of files yet.

My solution is to set up multiple parameters. One for each file. Obviously you’ll have adjust your API-endpoint as well to make this work. You can still work with lists in Bubble, but you’ll have to POST each items as a different parameter.

Looks like this at my end:

And the action to trigger the API:

Hope this helps!

1 Like

Hi @tim10 ,

Thanks for trying to help. Unfortunately, we can’t modify Eleven Lab’s endpoint to receive the files in multiple parameters as you suggested. You can only modify how you request things and you must request them as their docs say.

Anyways, thank you for trying to help.

Hey! Did you find a solution for this?

I have the same problem right now.

Are you trying to clone a voice with the eleven Labs API and would like to let the user to send multiple audios, right?

Hi,

Bubble support told me its a limitation of Bubble. I had to use Xano and it worked.

Vote for this feature here

@tim10

if it works it works :wink: using the same method too

Can you suggest me how can i do that using XANO ??

Xano didn’t work for me either. I could only send 1 file at a time. More info:

Hello All,

I have work out this issue using the Middleware developed in AWS Lambda.

I created one function which receive all files, in format { File , FileName , FilePurpose}. And from Lambda (developed using Python ) I sent all files in one parameter, and invoke third party API.