Recently I came to face an unusual problem while posting a form. The form post works fine when there is no attachment or the attachment image file size is less than 100kb. B
had the same problem, turns out that the order of the inputs matter, says right here on the github skipper page
It is important to realize that the benefit above(Text Parameters) relies on a crucial, simplifying assumption: that user agents send any text parameters before the first file parameter in the multipart HTTP request body. For instance, in an HTML form that means putting all of your tags after the other inputs. If you don't want to lay your form out that way, you'll want to use AJAX to submit it instead
The req.param
method is used to get the url parameters, body parameters, and query parameters. (reference)
if you're using multipart/form-data
to upload files, Sails use skipper to parse the data, you can simply get the file like following
req.file('name').upload(function (err, uploadedFiles){
if (err) return res.send(500, err);
return res.send(200, uploadedFiles);
});
With skipper, you have to put all your inputs files at the end of the form. Otherwise it could bug-out.
I would suggest checking the official file upload documentation from sails....
http://sailsjs.org/#!/documentation/concepts/File-Uploads
I followed the steps and it works for me (on sails v 0.11). Perhaps you missed something along the way?
better use blueimp jquery file upload plugin.. it have multiple features it may help you.