Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading torrent file to particular path using client.add() #61

Closed
Mookambika opened this issue Feb 6, 2017 · 7 comments
Closed

Comments

@Mookambika
Copy link

Hi,

Is it possible to download the torrent file directly to a specified folder. i am using the bellow function
client.add(torrentId, { path: 'http://localhost/projname/path' }, function (torrent) {
.....
......
});
torrent id is magnet url, but i am not able to get downloads in that folder and no error also. can you please check is that what i am doing is right?

@DiegoRBaquero
Copy link
Member

DiegoRBaquero commented Feb 6, 2017

You cannot download to an http path. You must use a disk path.

@Mookambika
Copy link
Author

Hi

Even i tried with disk path also its also not worked, can you please tell me after converting magnet url to torrent file how can i save the torrent file directly to a folder is there any other methods.

@DiegoRBaquero
Copy link
Member

Try './', it should download to whatever directory you run the command on.

Can you also provide which OS, Node version, and webtorrent-hybrid versions are you using?

@feross
Copy link
Member

feross commented Feb 8, 2017

Sorry, this isn't really a support forum. I'm going to close this. If you and others wish to continue discussion, don't let this stop you. 😄

@feross feross closed this as completed Feb 8, 2017
@Mookambika
Copy link
Author

Mookambika commented Feb 8, 2017

Hi

thanks for the reply, sorry i forgot to inform you that i am using web torrent for the browser not desktop, i want to download torrent file directly to specified path after conversion from magnet url.

@feross
Copy link
Member

feross commented Feb 8, 2017

@Mookambika Sorry, you can't download directly to the user's file system from a browser. This isn't allowed by the browser for security reasons, or any website could just save files randomly on your drive, overwriting important files.

You will need to use the file.getBlob or file.getBlobURL methods, documented here: https://webtorrent.io/docs to create a link to the file that the user can click to trigger a download. There is a code sample at the very bottom of the page.

@Mookambika
Copy link
Author

Hi

okay, thanks for the information to direct download to a path issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants