ipfs-webui
ipfs-webui copied to clipboard
File → menu → Download buffers entire file into a blob
- OS: Windows 10 x64
- Version of IPFS Desktop [0.18.1]
Describe the bug
https://streamable.com/9z175t
To Reproduce Steps to reproduce the behavior:
- Go to the file
- Click on more
- Scroll down to Download
- Blank Screen after some seconds.
Log files:
PD: I tried reinstalling, but same problem.
Hi @ZeroCool22! Thanks for the bug report. I could not reproduce it, which makes me think it may be related to RAM memory. I see you have 32 GB of RAM and that it reaches ~60% usage before crashing. How large is the file? Could you also try checking the developers console when it happens (CTRL+SHIFT+I)?
Hi @ZeroCool22! Thanks for the bug report. I could not reproduce it, which makes me think it may be related to RAM memory. I see you have 32 GB of RAM and that it reaches ~60% usage before crashing. How large is the file? Could you also try checking the developers console when it happens (CTRL+SHIFT+I)?
Here you go:
https://streamable.com/u0kchy
No help?
I really want to use IPFS... :(
@ZeroCool22 thank you for recording the demo, it is very useful. We will fix this, but for now you need to use a workaround: avoid using the "Download" ("Descarga") action from menu, and click on "Local gateway" instead:
Let us know if this works with your 7GB file.
@hacdias my understanding of the problem is that we need to change how "Download" context action of a single file is implemented on the Files screen. It reads correct URL from doFilesDownloadLink
but then downloads it using downloadFile
function from src/files/download-file.js, which buffers the entire thing in memory to construct a blob:
.
I believe creating a blob via window.URL.createObjectURL
in downloadFile
was necessary because we did not have ?download=true
four years ago (was introduced in 2020 in https://github.com/ipfs/go-ipfs/pull/7677), and we also displayed progress bar or something.
Today it is not necessary, and as we can see harms UX when a big file is downloaded. We should remove blob freation and leverage regular URL with added download=true
parameter instead. Code for tracking download progress also should be removed – browser will handle that.
Will you have time to submit a fix?
@lidel I think one of the issues is the directory: there's no way of downloading a directory via the gateway and the API is POST only (unless that changed recently)
Ref https://github.com/ipfs/go-ipfs/issues/7746
@hacdias afaik /api/v0/get
is also exposed on Gateway port, and there it should accept GET (POST restriction applies only to the RPC API port).
I think is fine to use that until we have a better way for fetching directories on Gateways.
:tada: This issue has been resolved in version 2.21.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: