skipper

nginx / sails.js: incomplete file upload

ぃ、小莉子 提交于 2020-01-14 05:10:12
问题 We are developing an app using sails.js. In this app we have an upload controller: https://github.com/makinacorpus/mnhn_bai/blob/master/api/controllers/Object3DController.js This controller use skipper under the hood, as explained in the documentation. Now the problem is that when we upload big files, they are incompletely stored, the uploaded size is never the same and varies from 7mb to 14mb for a 15 mb file. The architecture is as follow: haproxy -> nginx -> node.js/sails. If we replace

Sails.js Skipper: How to read the uploaded file stream during upload?

孤街醉人 提交于 2019-12-23 19:19:34
问题 I am using sails version 0.11 which comes bundled with skipper for file uploads. I need to upload big files of over 100 MB in size at least. Now I don't want the file upload to complete before I start further processing of the file on server. I want to read the file stream while it is being uploaded. Here is how I am trying to achieve the same: var csv = require("fast-csv"); bulk: function (req, res){ function parseEntry(entry){ return entry } var inputStream = req.file('employees'); var

Sails.js bodyParser - request entity too large on version 0.10.5

血红的双手。 提交于 2019-12-19 09:23:09
问题 I am trying to post a lot of data to my sails API and I get this 413 error: Unable to parse HTTP body- error occurred - Error: request entity too large I have tried a lot of solutions suggested in differents discussions but it never works and seems to be for previous sails version. (it’s always about changing the bodyParser options) Does anybody know the correct syntax for sails 0.10.5? Thanks a lot! 回答1: Does anybody know the correct syntax for sails 0.10.5? Thanks a lot! Take a look at this

Sails.js checking stuff before uploading files to MongoDB with skipper (valid files, image resizing etc)

▼魔方 西西 提交于 2019-12-18 04:23:13
问题 I'm currently creating a file upload system in my application. My backend is Sails.js (10.4), which serves as an API for my separate front-end (Angular). I've chosen to store the files I'm uploading to my MongoDB instance, and using sails' build in file upload module Skipper. I'm using the adapter skipper-gridfs (https://github.com/willhuang85/skipper-gridfs) to upload the files to mongo. Now, it's not a problem to upload the files themselves: I'm using dropzone.js on my client, which sends

Skipper in SailsJS (beta) image resize before upload

瘦欲@ 提交于 2019-12-17 20:34:56
问题 I'm using SailsJS (beta). I'm trying to find a way to use graphicsmagick to take the stream parsed by Skipper in SailsJS-beta to resize the image before calling the Skipper-function req.file('inputName').upload() . My goal is to take my large, original image, and resize it before uploading it. Sails beta have introduced the Skipper-file-parser which are poorly documented (at least I don't understand it). Please help me understand how to resize the image before upload. This works (code in my

nginx / sails.js: incomplete file upload

老子叫甜甜 提交于 2019-12-08 19:12:34
We are developing an app using sails.js. In this app we have an upload controller: https://github.com/makinacorpus/mnhn_bai/blob/master/api/controllers/Object3DController.js This controller use skipper under the hood, as explained in the documentation. Now the problem is that when we upload big files, they are incompletely stored, the uploaded size is never the same and varies from 7mb to 14mb for a 15 mb file. The architecture is as follow: haproxy -> nginx -> node.js/sails. If we replace the nginx reverse proxy by a simple apache + proxypass configuration, the uploads work flawlessly. If we

Aborted upload causes Sails js/Skipper to crash

那年仲夏 提交于 2019-12-07 06:17:09
问题 Ref: https://github.com/balderdashy/skipper/issues/49 Adapter: skipper-gridfs Basic controller code: req.file('fileTest') .upload({ // You can apply a file upload limit (in bytes) maxBytes: maxUpload, adapter: require('skipper-gridfs'), uri: bucketConnect, saveAs : function (__newFileStream,cb) { cb(null, __newFileStream.filename); } }, function whenDone(err, uploadedFiles) { if (err) { var error = { "status": 500, "error" : err }; return res.serverError(error); }else { I have a jQuery-File

Sails.js File upload with Skipper to AWS S3

眉间皱痕 提交于 2019-12-06 01:59:22
问题 I have a form where you can upload a file. I upload the file directly with skipper and it works perfectly. req.file('file').upload({ adapter: require('skipper-s3'), key: 'key', secret: 'secret', bucket: 'bucketname' }, function (err, uploadedFiles) { if (err){ // ko } else{ // ok } }); But I want to resize first and then upload the file, so: sharp(original).resize(800).quality(90).toBuffer(function(err, outputBuffer) { if (err) { // ko } // ok outputBuffer; }); So, my question is: How can

Aborted upload causes Sails js/Skipper to crash

纵饮孤独 提交于 2019-12-05 11:12:59
Ref: https://github.com/balderdashy/skipper/issues/49 Adapter: skipper-gridfs Basic controller code: req.file('fileTest') .upload({ // You can apply a file upload limit (in bytes) maxBytes: maxUpload, adapter: require('skipper-gridfs'), uri: bucketConnect, saveAs : function (__newFileStream,cb) { cb(null, __newFileStream.filename); } }, function whenDone(err, uploadedFiles) { if (err) { var error = { "status": 500, "error" : err }; return res.serverError(error); }else { I have a jQuery-File-Upload client ( https://blueimp.github.io/jQuery-File-Upload/ ) impementing the "cancel" procedure by

Uploading files using Skipper with Sails.js v0.10 - how to retrieve new file name

会有一股神秘感。 提交于 2019-12-05 00:54:28
问题 I am upgrading to Sails.js version 0.10 and now need to use Skipper to manage my file uploads. When I upload a file I generate a new name for it using a UUID, and save it in the public/files/ folder (this will change when I've got this all working but it's good for testing right now) I save the original name, and the uploaded name + path into a Mongo database. This was all quite straightforward under Sails v0.9.x but using Skipper I can't figure out how to read the new file name and path.