Error: request entity too large

后端 未结 21 3102
无人共我
无人共我 2020-11-22 06:36

I\'m receiving the following error with express:

Error: request entity too large
    at module.exports (/Users/michaeljames/Documents/Projects/Proj/mean/node         


        
21条回答
  •  北海茫月
    2020-11-22 07:15

    I've used another practice for this problem with multer dependancie.

    Example:

    multer = require('multer');
    
    var uploading = multer({
      limits: {fileSize: 1000000, files:1},
    });
    
    exports.uploadpictureone = function(req, res) {
      cloudinary.uploader.upload(req.body.url, function(result) {
        res.send(result);
      });
    };
    
    module.exports = function(app) {
        app.route('/api/upload', uploading).all(uploadPolicy.isAllowed)
            .post(upload.uploadpictureone);
    };
    

提交回复
热议问题