angularjs,node.js,sails.js,multipart,skipper
I changed to use skipper on backend which came with sails js by default. When sending post request to the backend, I needed to specify fileFormDataName to filename and I could use that name to get req.file('filename') on backend.
After looking skipper documentation I have found about saveAs options. Only have to put it inside req.file('name').upload to let it saved with your original name or with another custom name. this is the example: var newFilename = req.file('uploadFile')._files[0].stream.filename; req.file('uploadFile').upload({ adapter: require('skipper-s3'), key: 'KEY', secret: 'SECRET', bucket: 'BUCKET', ACL: 'public-read, saveAs:...
javascript,node.js,sails.js,skipper
The following when used in conjunction will give you the number of files that match the one your uploading based on the file name being uploaded. It will use regex to match based on this template image(1).jpg. So if you upload image.jpg it will look in your directory and find...
node.js,nginx,sails.js,skipper
So, the solution i found is to hack a bodyparser which use formidable. No more problem :). For the record, it was a bit of a hack to switch the bodyparser in the middlewares: config/http.js module.exports.http = { middleware: { bodyParser: false, cbodyParser: require('../bodyParser')( {urls: [/\/admin\/edit_object/]}), order: [ 'startRequestTimer', 'cookieParser',...