in app (sails 0.12.0) want extend limit of bytes send upon post request. i've followed comments in stackoverflow question
var skipper = require('skipper'); skipper.limit = 1024*1024*100; middleware: { bodyparser: skipper }
i still error:
"data": { "code": "e_exceeds_upload_limit", "name": "upload error", "maxbytes": 15000000, "written": 15007474, "message": "upload limit of 15000000 bytes exceeded (15007474 bytes written)" }
i've tried add code below directly under module.exports.http
, i've tried add in middleware
only.
bodyparser: (function () { var opts = {limit:'50mb'}; var fn; // default built-in bodyparser: fn = require('skipper'); return fn(opts); })
my question is: why none of these codes work , how can increase limit. solution can not elegant.
everything need - set
maxbytes
attribute in object of options upload() method of skipper upstream.
req.file('image').upload({maxbytes: 50000000}, function (err, uploadedfiles) { if (err) return res.servererror(err.message); if(uploadedfiles.length > 0) { // uploaded images want ..... } });
Comments
Post a Comment