Open mlegner opened 2 months ago
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.
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.
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.