skipper

Sails.js File upload with Skipper to AWS S3

跟風遠走 提交于 2019-12-04 05:43:31
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 upload the outputBuffer instead of req.file('file') ? Instead of using skipper-s3 you can use the aws-sdk

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

瘦欲@ 提交于 2019-12-01 06:29:34
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! Does anybody know the correct syntax for sails 0.10.5? Thanks a lot! Take a look at this resolution (sails v.0.11.0, config/http.js): module.exports.http = { middleware: { ... }, bodyParser:

Uploading multiple files with Sails.js 0.10 and Skipper using Dropzone.js

北战南征 提交于 2019-11-29 10:56:08
I have an issue with multiple file upload in my sails app. I am trying to implement multiple file upload with Dropzone.js and my backend is Sails v0.10.0-rc8. Now when I upload some files via dropzone, I see that in case of multiple upload it sends the files with separate params in the request. The param names are 'photo[0]', 'photo[1]', 'photo[2]',... . I am getting the files in controller like this: req.file(file).upload(function (err, files) { // save the file }); But when there is more then one file submitted, the request is being passed to controller before all files are parsed and stored

Skipper in SailsJS (beta) image resize before upload

拈花ヽ惹草 提交于 2019-11-28 12:09:28
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 controller action): req.file('fileName').upload('storedImage.png', function(err, files){ // File is now

Uploading multiple files with Sails.js 0.10 and Skipper using Dropzone.js

爱⌒轻易说出口 提交于 2019-11-28 04:23:10
问题 I have an issue with multiple file upload in my sails app. I am trying to implement multiple file upload with Dropzone.js and my backend is Sails v0.10.0-rc8. Now when I upload some files via dropzone, I see that in case of multiple upload it sends the files with separate params in the request. The param names are 'photo[0]', 'photo[1]', 'photo[2]',... . I am getting the files in controller like this: req.file(file).upload(function (err, files) { // save the file }); But when there is more