skipper-disk

Receive streaming file uploads on your local filesystem.

Disk Blob Adapter

Local filesystem adapter for receiving upstreams. Particularly useful for streaming multipart file uploads from the Skipperbody parser.

Installation

$ npm install skipper-disk --save

This module is part of the default configuration in Sails.

If you're using this module outside of Sails (e.g. Express or a vanilla Node.js server), make sure you have skipper itself installed as your body parser.

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({
  // ...options here...
},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 repo, especially the section on "[https://github.com/balderdashy/skipper#uploading-files-to-disk](Uploading to Local Disk)".

Contribute

Check out the contribution guideand roadmap.

To run the tests:

$ npm test

License

MIT

Mike McNeil, Balderdash Design Co., Sails Co.

See LICENSE.md.

This module is part of the Sails framework, and is free and open-source under the MIT License.

HomePage

https://sailsjs.com/support

Repository

https://github.com/balderdashy/skipper-disk


上一篇:dot-access
下一篇:政采云前端小报第51期

相关推荐

  • webpack-disk-plugin

    Webpack disk plugin Webpack Disk Plugin =================== Build Statustravimgtravsite This plug...

    1 年前
  • skipper-adapter-tests

    Generic acceptance tests for Skipper adapters skipperadaptertests ============ Generic acceptance ...

    8 个月前
  • skipper

    Bodyparser for Express/Sails. Exposes simple API for streaming multiple files to disk, S3, etc. with...

    8 个月前
  • sails-disk

    Persistent localdisk (and/or memory) adapter for Sails.js / Waterline. sailsdisk A local disk ad...

    1 年前
  • html-webpack-harddisk-plugin

    Write html files to hard disk even when using the webpack dev server or middleware Harddisk extensi...

    2 个月前
  • fixture-skipper

    skip fixture tests with "" prefix fixtureskipper Greenkeeper badge(https://badges.greenkeeper.i...

    1 年前
  • diskspace

    A simple disk space checker module. Check out the GitHub page for more details. build status(https:...

    1 年前
  • diskette

    Stream buffers and strings efficiently inmemory Diskette ======== Build Status(https://travisci.or...

    2 个月前
  • diskcache

    Caches data on disk and optionally in memory. diskcache ======== Connect middleware for caching HT...

    7 个月前
  • disk-map

    A map structure stored on disk diskmap NPM versionnpmimagenpmurl Downloadsdownloadsimagenpmurl Bui...

    1 年前

官方社区

扫码加入 JavaScript 社区