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

With the --list-directory option add download attribute to appropriate links #111

Open
mlegner opened this issue Jul 9, 2024 · 2 comments
Labels
bug Something isn't working enhancement New feature or request portal site-builder
Milestone

Comments

@mlegner
Copy link
Collaborator

mlegner commented Jul 9, 2024

The --list-directory option added in #106 is convenient to build a file-browser like website from any directory. However, the links it creates are all direct links, which means the browser attempts to display the files.

This makes sense for some file types (text, images, maybe PDFs) but not for others (binary files). At least for the second category, it would be good to specify the link as <a href="..." download>...</a>. The easiest solution would be to just add it to all the links.

Unfortunately, this doesn't seem to work with the current portal: It simply downloads a 404.html page in my case, so this seems to be a separate issue.

@mlegner mlegner added bug Something isn't working enhancement New feature or request portal site-builder labels Jul 9, 2024
@mlegner mlegner added this to the Testnet milestone Jul 9, 2024
@mlegner
Copy link
Collaborator Author

mlegner commented Jul 10, 2024

Maybe a better solution would be a Content-Disposition header.

But the download problem also occurs when "manually" downloading a file by right-clicking the link and selecting "Download linked file", so it would be good to solve this anyway.

@giac-mysten
Copy link
Collaborator

One solution could be to use js instead of plain links, so that the request has to go through the service worker... will think about this.

@mlegner mlegner modified the milestones: Testnet, Backlog Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request portal site-builder
Projects
None yet
Development

No branches or pull requests

2 participants