Skip to content

Commit

Permalink
Documentation on how to upload multiple files at the same time. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
richardgirges committed Jan 14, 2017
1 parent a1090b8 commit eb7f3ab
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@ app.post('/upload', function(req, res) {
</html>
```

### 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
<input type="file" name="my_profile_pic" />
<input type="file" name="my_pet" />
<input type="file" name="my_cover_photo" />
```

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)

Expand Down

0 comments on commit eb7f3ab

Please sign in to comment.