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 enterprisesFile path seeding problems #495
Comments
This comment has been minimized.
This comment has been minimized.
|
I've overriden the method that was throwing that exception and got to
So it's currently not possible to seed anything that's outside |
This comment has been minimized.
This comment has been minimized.
|
Right, probably by (browser) design. Otherwise it would mean Javascript code could seed arbitrary files from your computer! :) I think at least Chrome's sandbox stops this type of access and requires explicit user intervention (the file input) to do it. In other words, this isn't a bug and it's outside the scope of WebTorrent, IMO. |
This comment has been minimized.
This comment has been minimized.
|
It might be a bug in chrome, or the documentation could be referring to when you are using webtorrent-hybrid, which allows you to read from the file system. |
This comment has been minimized.
This comment has been minimized.
|
The API documentation isn't clear, but the examples before it distinguish between "in the browser" and "in node.js." In the browser you must have user intervention (drag and drop, for example). In node.js, you don't. As for Chrome, it's definitely not a bug. Even the dead/deprecated/abandoned HTML5 file system API would only let you access files inside the sandbox rather than arbitrary files on the machine. |
This comment has been minimized.
This comment has been minimized.
|
Filesystem access is not allowed in the browser. Using a file path is only supported when using WebTorrent in node.js. We should improve the error message that you get since |
In the browser, WebTorrent’s `client.seed()` function returns “Uncaught TypeError: fs.stat is not a function” when passing in a file path, because fs.readdir is defined by brfs (I think). Let’s check for fs.stat instead. For webtorrent/webtorrent#495 (comment)
This comment has been minimized.
This comment has been minimized.
|
The error message is fixed in webtorrent/create-torrent@2d4f01e |
I'm trying this one
And getting back
Documentation clearly says that the seed method accepts file path as a string. What am I doing wrong?
JS Bin example