A project written in Vue and nodejs requires image upload, but report error:
PayloadTooLargeError: request entity too large at readStream
Solution: add Middleware
const bodyParser = require('body-parser');
router.use(bodyParser.urlencoded({extended: false, limit: '10mb'}));
The default is 100kb, which can be replaced by a large number. The unit can be MB, etc
Read More:
- How to Solve Nginx 413 Error (request entity too large)
- [Solved] ELK Log System Error: “statusCode“:429,“error“:“Too Many Requests“,“message“ Data too large
- [Solved] Uncaught Error: Provide the “history“ option when calling “createRouter()“
- [Solved] NPM Error: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
- [Solved] Axios Error: Request body larger than maxBodyLength limit
- TypeError: res.render is not a function
- Fetch Error: Failed to execute ‘fetch’ on ‘Window’: Request with GET/HEAD method cannot have body
- [Solved] Vscode Error: “export ‘default‘ (imported as ‘VueRouter‘) was not found in ‘vue-router‘
- [Solved] IE Browser Error: unhandled promise rejection error: access is denied. File stream Download
- VueUncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/
- [Solved] React import the Path of Image error: cannot find mouse ‘.‘
- The reason and solution for the error ECONNRESET of the httpClieint request of Node.js
- [Solved] Router Pinia error: getActivePinia was called with no active Pinia. Did you forget to install pinia
- [Solved] Vue + uniapp Uncaught TypeError: Cannot read property ‘getters‘ of undefined
- Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to crrent location: “/home“
- [Solved] gulp-sass Package scss Files Error: Error in plugin “gulp-sass“Message:
- Solve the problem of repeatedly clicking the same route console in Vue to report an error
- [Solved] vue-roter 4 Error: Error: Invalid route component/Uncaught (in promise) Error: Invalid route component
- Vue: How to Solve error avoided redundant navigation to current location: “/xxx”
- [Solved] Uncaught (in promise) Error: Avoided redundant navigation to current location: