Insomnia: [Question] Upload multiple Multipart files in one parameter

Created on 28 Aug 2019  ·  9Comments  ·  Source: Kong/insomnia

  • Insomnia Version: 6.6.2 (6.6.2.2932)
  • Operating System: macOS Mojave 10.14.6 (18G87)

Details

I am trying to create a POST request with Multipart Form Body and uploading multiple files in the same key/value pair. Insomnia doesnt seem to allow me to select multiple files. I could successfully do it in another REST Client. Is this a limitation or am I doing it wrong?

Sample curl command :

curl -X POST \
 <url> \
 -H ‘cache-control: no-cache’ \
 -H ‘content-type: multipart/form-data; \
 -F =@<file1-location> \
 -F =@<file2-location> \
 -F =@<file3-location>
stale

Most helpful comment

I think this might depend on the server-side technologies used. I'm using Express.js and multer to handle multipart/form-data requests. The only format that doesn't induce MulterError: Unexpected field is multiple entries with the same name without any brackets.

image

All 9 comments

Your Curl command is sending three files with no name for each. You can do the same thing in Insomnia like this:

image

Hello @gschier, how do I do this using GraphQL? Thanks!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Your Curl command is sending three files with no name for each. You can do the same thing in Insomnia like this:

image

Is it possible to send this files in one variable?

To upload files in one variable
Снимок экрана 2020-03-16 в 11 20 44

Sorry if I allow myself @JuricT , but the correct way is:
immagine

Thanks

I think this might depend on the server-side technologies used. I'm using Express.js and multer to handle multipart/form-data requests. The only format that doesn't induce MulterError: Unexpected field is multiple entries with the same name without any brackets.

image

@weeix your way is right when useing express.js and multer!

@weeix It works perfectly with Spring also

multtiplefiles

Multipart[] or File Array can be called this way using the same attribute name in insomnia.

Was this page helpful?
0 / 5 - 0 ratings