multer icon indicating copy to clipboard operation
multer copied to clipboard

Field value too long

Open thanhthang20 opened this issue 9 years ago • 7 comments

screen shot 2016-12-28 at 10 44 36 am

var formData = new FormData();
formData.append('text', myData);

'myData' content is rich text data (text + image in base64) around 15mb is encoded as multipart

thanhthang20 avatar Dec 28 '16 03:12 thanhthang20

Increase the field data limit using the limits option:

multer({
  limits: { fieldSize: 25 * 1024 * 1024 }
})

LinusU avatar Dec 28 '16 21:12 LinusU

If anyone arrives here after seeing this error and wonders how to intercept it http://expressjs.com/en/guide/error-handling.html states to use:

app.use(function (err, req, res, next) {
  console.error(err.stack)
  res.status(500).send('Something broke!')
})

ubershmekel avatar Dec 23 '17 03:12 ubershmekel

Increase the field data limit using the limits option:

multer({
  limits: { fieldSize: 25 * 1024 * 1024 }
})

where does this go?

creightontaylor avatar Dec 29 '21 03:12 creightontaylor

where does this go?

@creightontaylor When you initialize Multer upload function var upload = multer({ storage: storage,limits:{fieldSize: 25 * 1024 * 1024} });

ahsan-alii avatar Jul 19 '22 06:07 ahsan-alii

What is the difference between fieldSize and fileSize?

squivix avatar Jan 27 '23 12:01 squivix

¿ Cuál es la diferencia entre fieldSizey fileSize?

fields seria para campo y el file para archivos bro

jcarlosabc avatar Aug 09 '23 19:08 jcarlosabc

Increase the field data limit using the limits option:

multer({
  limits: { fieldSize: 25 * 1024 * 1024 }
})

This works. The default upload limit in multer is around 1 MB. So if you want to send more data you have to increase the limits. 25 * 1024 * 1024 (in bytes) will give you around 25 MB.

JoeBrar avatar Sep 01 '24 07:09 JoeBrar