Skip to content

Commit eb7f3ab

Browse files
committed
Documentation on how to upload multiple files at the same time. Closes #10
1 parent a1090b8 commit eb7f3ab

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,26 @@ app.post('/upload', function(req, res) {
7777
</html>
7878
```
7979

80+
### Uploading Multiple Files
81+
express-fileupload supports multiple file uploads at the same time.
82+
83+
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`:
84+
```html
85+
<input type="file" name="my_profile_pic" />
86+
<input type="file" name="my_pet" />
87+
<input type="file" name="my_cover_photo" />
88+
```
89+
90+
These uploaded files would be accessible like so:
91+
```javascript
92+
app.post('/upload', function(req, res) {
93+
// Uploaded files:
94+
console.log(req.files.my_profile_pic.name);
95+
console.log(req.files.my_pet.name);
96+
console.log(req.files.my_cover_photo.name);
97+
});
98+
```
99+
80100
### Using Busboy Options
81101
Pass in Busboy options directly to the express-fileupload middleware. [Check out the Busboy documentation here.](https://github.com/mscdex/busboy#api)
82102

0 commit comments

Comments
 (0)