Socket
Book a DemoInstallSign in
Socket

upload-component

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

upload-component

file upload and progress api

latest
npmnpm
Version
0.1.1
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

upload

FAQs

Package last updated on 18 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts