Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name:
- 'gallery', maxCount: 8 }])
- app.post('/cool-profile', cpUpload, function (req, res, next) {
- // req.files is an object (String -> Array) where fieldname is the key, and
- the value is array of files
- //
- // e.g.
- // req.files['avatar'][0] -> File
- // req.files['gallery'] -> Array
- //
- // req.body will contain the text fields, if there were any
- })
Add Comment
Please, Sign In to add comment