component-upload
file upload and progress api
Last updated 6 years ago by tootallnate .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install component-upload 
SYNC missed versions from official npm registry.

upload

file upload and progress api

Installation

$ component install component/upload

Events

  • error an error occurred
  • abort upload was aborted
  • progress (e) upload in progress (e.percent, e.totalSize etc)
  • end upload is complete

API

Upload(file)

Initialize an Upload with the given file, where file is a File object, for example from a input.files[0] FileList.

var upload = new Upload(file);
var upload = Upload(file);

Upload#to(path, [fn])

POST the multipart upload to path and invoke fn(err, res).

upload.to('/upload');
upload.on('progress', reportProgress);
upload.on('end', done);

Running tests

Run the Express test server:

$ npm install
$ make test

License

MIT

Current Tags

  • 0.3.0                                ...           latest (6 years ago)

1 Versions

  • 0.3.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 53
Last Day 0
Last Week 24
Last Month 39
Dependencies (1)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |