From eb7f3ab6b7e03010ffb80f74290226ad1c8280b4 Mon Sep 17 00:00:00 2001 From: Richard Girges Date: Sat, 14 Jan 2017 10:55:19 -0800 Subject: [PATCH] Documentation on how to upload multiple files at the same time. Closes #10 --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 5ab95e5..91b0023 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,26 @@ app.post('/upload', function(req, res) { ``` +### Uploading Multiple Files +express-fileupload supports multiple file uploads at the same time. + +Let's say you have three files in your form, each of the inputs with the name `my_profile_pic`, `my_pet`, and `my_cover_photo`: +```html + + + +``` + +These uploaded files would be accessible like so: +```javascript +app.post('/upload', function(req, res) { + // Uploaded files: + console.log(req.files.my_profile_pic.name); + console.log(req.files.my_pet.name); + console.log(req.files.my_cover_photo.name); +}); +``` + ### Using Busboy Options Pass in Busboy options directly to the express-fileupload middleware. [Check out the Busboy documentation here.](https://github.com/mscdex/busboy#api)