javascript - Node.js connect-multiparty catch Error: maximum file length exceeded -
i want limit file upload size , inform user exceeding limit, don't know should catch error.
limit setting:
var multipart = require('connect-multiparty'); var multipartmiddleware = multipart({ maxfilessize : 2 * 1024 });
upload post:
app.post('/upload', multipartmiddleware, function (req, res) {