Skip to content

Instantly share code, notes, and snippets.

@williamcotton
Last active August 29, 2015 14:22
Show Gist options
  • Save williamcotton/335f06aec028272eefa1 to your computer and use it in GitHub Desktop.
Save williamcotton/335f06aec028272eefa1 to your computer and use it in GitHub Desktop.
var dragDrop = require('drag-drop');
dragDrop('#drop', function (files) {
files.forEach(function (droppedFile) {
file = droppedFile;
bitstoreClient.files.put(file, function (err, res) {
var receipt = res.body;
hash_sha1 = receipt.hash_sha1;
hash_btih = receipt.hash_btih;
uri = receipt.uri;
size = receipt.size;
torrent = receipt.torrent;
document.getElementById("hash_sha1").innerHTML = hash_sha1;
document.getElementById("hash_btih").innerHTML = hash_btih;
document.getElementById("size").innerHTML = size;
document.getElementById("uri").innerHTML = uri;
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment