SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top