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 Files from File Page #345

Open
dmachi opened this issue May 16, 2023 · 1 comment
Open

Download Files from File Page #345

dmachi opened this issue May 16, 2023 · 1 comment
Assignees

Comments

@dmachi
Copy link
Contributor

dmachi commented May 16, 2023

Currently you can only download a file from the file browser. If you click on the link to one of the files, for example:

https://ptest.net.science/files/179833f8-057e-4a2f-a874-a211438bea71/US_states_hockey_stick_grid_hosp_all_states_10_weeks.png

You can see all the details about the file, but you cannot download it. Please add a Download button/link on these pages. The link should not be tab specific. So it can go on the right like this:

Monosnap Net Science 2023-05-16 09-37-36

The link should be done as a download link, eg: <a href="myfile.pdf" download>Click to Download</a> (though still shown using the same download icon we normally see).

There is one additional note for the download link. I think this only works for same-origin requests. To assist, I am planning to proxy the file service in to the net.science domain(s) for these requests only (the rest of the SciDuct requests should go to the normal sciduct urls).

Replaces ticket #276

@dmachi
Copy link
Contributor Author

dmachi commented May 17, 2023

I have added a proxy url for the file service that can be used for these download urls. it is simply /_fs/ -> https://sciduct.bii.virginia.edu/fs/. So for downloading a url like https://net.science/_fs/file/735a74f9-8a92-47d7-a5f3-d06548bf6332?http_accept=application/octet-stream&http_authorization=<TOKEN> should work. Remember to exclude the http_authorization when the user isn't logged in. Here is a curl example:

curl -o va.pt.txt "https://net.science/_fs/file/735a74f9-8a92-47d7-a5f3-d06548bf6332?http_accept=application/octet-stream&http_authorization=$TK"

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