multer set file size limit code example
Example 1: php get size of file
$fileSizeInBytes=filesize("/path/to/myfile.txt");
Example 2: how to limit the file size in multer
var upload = multer({
storage: storage,
limits: { fileSize: maxSize }
}).single('bestand');
Example 3: how to set file type and size in multer
var multer = require('multer')
var upload = multer().single('avatar')
app.post('/profile', function (req, res) {
upload(req, res, function (err) {
if (err instanceof multer.MulterError) {
} else if (err) {
}
})
})