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

How to set the opts.path in cordova #1599

Closed
snowww1014 opened this issue Mar 22, 2019 · 0 comments
Closed

How to set the opts.path in cordova #1599

snowww1014 opened this issue Mar 22, 2019 · 0 comments

Comments

@snowww1014
Copy link

@snowww1014 snowww1014 commented Mar 22, 2019

Hello, I'm very interesting in webtorrent.
I have writed torrent client in electron, and I am making ionic cordova app for torrent client.

I implemented webtorrent seed and add function as follows.
client.add(magnetURI, torrent => {})
client.seed(new Blob([new Uint8Array(res)]))

I want to know

  1. In android phone, the path of downloaded file.
  2. In android phone, the example to set opt.path. I writed client.add(magnet, {path: 'file:///storage/emulated/0'}, function()). But in that location cannot find downloaded file.

Please help me.

Thank you.

If you're using Cordova, do you have access to the user's filesystem?

If so, you can use the same approach as you'd do in Node.js, which is to re-add the torrent with client.add and make sure to specify the same value for opts.path. Then, WebTorrent will check that file, verify it, and continue downloading from the place it left off.

Originally posted by @feross in #1330 (comment)

@snowww1014 snowww1014 closed this Apr 17, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.