Disk Blob Adapter
Local filesystem adapter for receiving upstreams. Particularly useful for streaming multipart file uploads from the Skipper body parser.
========================================
Installation
$ npm install skipper-disk --save
Also make sure you have skipper installed as your body parser.
Skipper is installed by default in Sails as of v0.10.
========================================
Usage
This module is bundled as the default file upload adapter in Skipper, so the following usage is slightly simpler than it is with the other Skipper file upload adapters.
In the route(s) / controller action(s) where you want to accept file uploads, do something like:
req.file('avatar')
.upload({
},function whenDone(err, uploadedFiles) {
if (err) return res.negotiate(err);
else return res.ok({
files: uploadedFiles,
textParams: req.params.all()
});
});
For more detailed usage information and a full list of available options, see the Skipper docs, especially the section on "[https://github.com/balderdashy/skipper#uploading-files-to-disk](Uploading to Local Disk)".
========================================
Contribute
See CONTRIBUTING.md
.
To run the tests:
$ npm test
Also be sure to check out ROADMAP.md in the Skipper repo.
========================================
License
MIT
© 2013, 2014-
Mike McNeil, Balderdash & contributors
See LICENSE.md
.
This module is part of the Sails framework, and is free and open-source under the MIT License.