Question

How to upload multiple files using Webhook action?


Badge

I have a zap that POSTS this data to a WebHook. The webhook is expecting multiple files using multipart/form-data. If I choose Webhooks By Zapier -> Post I can see that it let’s me add one file; however I cannot find a way to upload multiple files at once.

The webhook is expecting formatting as follows:

curl --location --request POST 'https://api.examplewebservice.com/convert/merge/docx/multi' \

--header 'Content-Type: multipart/form-data' \

--header 'Apikey: YOUR-API-KEY-HERE' \

--form 'inputFile1=@"/path/to/file"' \

--form 'inputFile2=@"/path/to/file"' \

--form 'inputFile3=@"/path/to/file"' \

--form 'inputFile4=@"/path/to/file"'
 

Is there a way to do this?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

19 replies

Userlevel 7
Badge +14

Hi @LBernard 

Good question.

Try using a Custom Request with the Webhooks app.

 

Badge

Hi @LBernard 

Good question.

Try using a Custom Request with the Webhooks app.

 

I tried this but I can’t see how this would work with a custom request.

Userlevel 7
Badge +14

@LBernard 

Please link to the API documentation you are referencing for configuring the request, thanks.

Badge

I am using an API by cloudmersive that helps me merge multi docx files. The end-point I am using is MergeDocument. See https://api.cloudmersive.com/swagger/index.html?urls.primaryName=Convert%20API

Userlevel 7
Badge +14

@LBernard 

Have you tried using a regular POST request with the parameters configured in the Data section?

 

 

Badge

Yes - if i add the parameters like inputFile1 and inputFile2 to the data section as you suggested then it only let’s me add text to the value field. 

 

Perhaps there is a method to enocde the files into text but I’m not sure if that’s possible and if so how to do this?

Userlevel 7
Badge +14

@LBernard 

Are you trying to pass a File URL or a File Object into the inputFile1, etc?

Badge

If you use the form, as suggested, you can only add text.
Therefore for inputFile1, inputFile2, etc I add text which is a url to a file but that doesn’t work.

From what I can tell there is no way to add an actual file - unless I am missing something.

Userlevel 7
Badge +14

@LBernard 

Can you post screenshots with how your Zap step is configured for us to have more context?

Badge

Please see the screenshot below:

I have tried two different options - either trying to attach an actual file to the form or entering a URL of the file. Entering a URL of a file doesn’t seem to work as it recognises it simply as text and adding the file itself doesn’t seem to work either. Is there something else I can try?

 

 

Userlevel 7
Badge +14

@LBernard

These need to be file URLs, not file objects.

You may need to upload those to a publicly accessible cloud storage drive in order to get the file URLs to use in the Zap.

 

Badge

I tried uploading files to Google Drive and then using the “Self link” and the “Download URL” but it simply treats it as text and doesn’t work. Any other idea?
 

 

Userlevel 7
Badge +14

@LBernard

The Files need to be publicly accessible, so you may need to adjust the File Sharing Preference settings.

 

Badge

I tried this. I used the option that anyone on the internet can edit but still not working.

I’m not sure what else to try?

 

Userlevel 7
Badge +14

@LBernard 

The Shareable Link is not the right link to use.

Needs to be a direct link to the file.

 

Article to reference for which GDrive file link format to use:

 

Badge

I am using a direct link by adding the text of the url and then the ID of the file but it seems to consider that simply as text?

 

 

Userlevel 7
Badge +14

@LBernard 

Make sure you have the correct headers set

 

 

 

Badge

Hello

I’ve added this - but still doesn’t seem to work

 

Badge

any thoughts on this?