Guest User

Untitled

a guest
Jan 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. var cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name:
  2. 'gallery', maxCount: 8 }])
  3. app.post('/cool-profile', cpUpload, function (req, res, next) {
  4. // req.files is an object (String -> Array) where fieldname is the key, and
  5. the value is array of files
  6. //
  7. // e.g.
  8. // req.files['avatar'][0] -> File
  9. // req.files['gallery'] -> Array
  10. //
  11. // req.body will contain the text fields, if there were any
  12. })
Add Comment
Please, Sign In to add comment