var storage = multer.diskStorage({
destination: (req, file, cb) => {
cb(null, '/home/innvoot/Desktop/Projects/innmee/innmee_api/classes/uploadedProfilePics')
},
filename: (req, file, cb) => {
cb(null, file.fieldname + "-" + Date.now() + "-" + file.originalname)
}
});
var upload = multer({storage: storage});
Ошибка при загрузке файлов изображений на экспресс-сервер с использованием мультера
> PayloadTooLargeError: request entity too large
> at readStream (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/raw-body/index.js:155:17)
> at getRawBody (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/raw-body/index.js:108:12)
> at read (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/body-parser/lib/read.js:77:3)
> at urlencodedParser (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/body-parser/lib/types/urlencoded.js:116:5)
> at Layer.handle [as handle_request] (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/express/lib/router/layer.js:95:5)
> at trim_prefix (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/express/lib/router/index.js:317:13)
> at /home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/express/lib/router/index.js:284:7
> at Function.process_params (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/express/lib/router/index.js:335:12)
> at next (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/express/lib/router/index.js:275:10)
> at jsonParser (/home/innvoot/Desktop/Projects/innmee/innmee_api/node_modules/body-parser/lib/types/json.js:119:7)
> message: 'request entity too large', expected: 299371, length:
> 299371, limit: 102400, type: 'entity.too.large'
Я просмотрел весь свой код, и нужно только такое количество доказательств, чтобы показать, чего я хочу больше, что откроет многомоего проекта.
как обработать эту ошибку.