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

Download large file using browser's load bar #2555

Open
julien-louis opened this issue Dec 18, 2024 · 0 comments
Open

Download large file using browser's load bar #2555

julien-louis opened this issue Dec 18, 2024 · 0 comments

Comments

@julien-louis
Copy link
Collaborator

julien-louis commented Dec 18, 2024

The browser's download menu & loading bar is only triggered by using <a href links, not by using js libs. The problem is that, in order to dl a dataset, we have to use js because we have to set the auth token, at minimum. So currently we dl the file with js as a blob and then create an hidden fake link from that blob into the dom, then we click it with js. It triggers the browser's dl menu BUT only when the blob is entirely downloaded, which can be very long with large files, leaving the user with almost nothing going on it's screen (apart from the spining cog), him wondering if there is a bug. That is our problem.

So, I see 2 solutions :

1. download bar in the left bar's "Jobs" when the blob dl takes more than, let's say, 5 seconds

2. unique temporary secured links :

  1. from the UI, the user dl a file (zip, pdf, ...), using usual keycloak auth
  2. the spring api responds with a temp url
    • random hash
    • short time validity
    • spring stores the url along with it's corresponding ressource real link
  3. the UI creates a fake <a href with the provided link and auto clicks it
  4. the spring api, catching the request on a non authenticated endpoind, responds with the real ressource
  5. the browser dl menu is triggered
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

1 participant