Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUpload with file input, not dragDrop #167
Closed
Comments
This comment has been minimized.
This comment has been minimized.
|
You should be able to use WebTorrent with a file input like this: var WebTorrent = require('webtorrent')
document.getElementById('files').addEventListener('change', handleFileSelect, false)
function handleFileSelect (evt) {
var files = evt.target.files // FileList object
client.seed(files, function (torrent) {
console.log(torrent.infoHash)
})
} The (Sidenote: It looks like you're using an older version of |
This comment has been minimized.
This comment has been minimized.
|
This was fixed in webtorrent a while ago, you can see a file input working with webtorrent on http://instant.io. :) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm trying to get file uploads working with a file input instead of just drag and drop.
I noticed that dragDrop passes dropped files through some conversion and the files that end up getting sent to
client.seed( FILES...are not file objects anymore but a specially constructed object that looks like this:How can I hookup a file input so that when you click on it and add a file it gets pushed through this same process and is able to be seeded?