0.3.0 • Published 11 years ago
component-dropload v0.3.0
Dropload
Drag and drop upload component.
Installation
$ component install component/droploadEvents
upload(upload) a file was droppedtext(string) string representationurl(string) url representationhtml(string) html representationdrop(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 testLicense
MIT
0.3.0
11 years ago