Track tasks and feature requests
Join 40 million developers who use GitHub issues to help identify, assign, and keep track of the features and bug fixes your projects need.
Sign up for free See pricing for teams and enterprisesUpload with file input, not dragDrop #167
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. :) |
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?