sails: Error when attempting to upload a file that exceeds 'maxBytes' limit

Error when attempting to upload a file that exceeds ‘maxBytes’ limit, is there anything wrong with skipper or is it my problem?

E:\h.acfun.tv.admin\node_modules\sails\node_modules\skipper\node_modules\skipper-disk\standalone\build-progress-stream.js:129
 Garbage collecting file `' + __newFile.filename + '` located @ ' + fd + '...'
                                                                    ^
ReferenceError: fd is not defined
    at gc (E:\h.acfun.tv.admin\node_modules\sails\node_modules\skipper\node_modules\skipper-disk\standalone\build-progress-stream.js:129:96)
    at Transform.singleFileProgress (E:\h.acfun.tv.admin\node_modules\sails\node_modules\skipper\node_modules\skipper-disk\standalone\build-progress-stream.js:134:9)
    at Transform.emit (events.js:95:17)
    at Transform.__progress__._transform (E:\h.acfun.tv.admin\node_modules\sails\node_modules\skipper\node_modules\skipper-disk\standalone\build-progress-stream.js:42:10)
    at Transform._read (_stream_transform.js:179:10)
    at Transform.Readable.read (_stream_readable.js:323:10)
    at flow (_stream_readable.js:591:52)
    at WriteStream.<anonymous> (_stream_readable.js:575:7)
    at WriteStream.emit (events.js:92:17)
    at onwriteDrain (_stream_writable.js:289:12)
    at afterWrite (_stream_writable.js:277:5)

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

@trungducng just trying to fix this i put in ur upload options maxBytes:10000000000000, and works. i just put 10000000000000 i think if u need < than that should work. let me know if u solved with this

I’m also experiencing this problem. My sample code is

var uploadOptions = {
    dirname: 'D:/Khufu_I/Videos',
   maxBytes: 20 * 1000 * 1000
}

req.file('video').upload(uploadOptions, function videoUploaded(err, uploadedFiles) {
  if (err) return res.serverError(err);
  if (!uploadedFiles || !uploadedFiles[0]) {
    return res.badRequest('Video was not uploaded.');
  }
});

The program crashes without hitting any of the errors.