Drag and drop uploads
JavaScript HTML Makefile
Latest commit 1847d2b Mar 16, 2015 @TooTallNate TooTallNate Release 0.3.0
Permalink
Failed to load latest commit information.
test add url / text / html support Feb 27, 2013
.gitignore Initial commit Sep 12, 2012
History.md Release 0.3.0 Mar 16, 2015
Makefile Initial commit Sep 12, 2012
Readme.md fix docs Apr 25, 2013
component.json Release 0.3.0 Mar 16, 2015
index.js add "drop" (e) event Apr 22, 2013
package.json Release 0.3.0 Mar 16, 2015

Readme.md

Dropload

Drag and drop upload component.

Installation

$ component install component/dropload

Events

  • upload (upload) a file was dropped
  • text (string) string representation
  • url (string) url representation
  • html (string) html representation
  • drop (event) a drop was performed

Example

var Dropload = require('dropload');
var drop = Dropload(document.getElementById('drop'));

drop.on('error', function(err){
  console.error(err.message);
});

drop.on('upload', function(upload){
  console.log('uploading %s', upload.file.name);
  upload.to('/upload');
});

drop.on('text', function(str){
  console.log('text "%s"', str);
});

drop.on('url', function(str){
  console.log('url "%s"', str);
});

drop.on('html', function(str){
  console.log('html "%s"', str);
});

Running example

Run the Express test server:

$ npm install
$ make test

License

MIT