file_server works correctly, however some files open in a browser instead of downloading. I’d prefer users to click a link and download instead of browser opening, such as an mp4 and then it currently streams instead of downloads. Users can rightclick and save video as. Previously I had caddy1 and used a template file, however I find that caddyv2 file_server being much faster without a template file I was using previously. Previously I got around this via this download code in the a href link.
<a download href="{{.URL}}">{{.Name}}</a>
Is there a way to edit the default template to have this effect?
4. Error messages and/or full log output:
None
5. What I already tried:
I tried my previous template file, it works however about 5x slower than the built in file_server template. I looked for the default template as well as at others. I prefer the built in, just with this download in the a href if possible. Is there a way to copy the default template and edit it?
Moved the <a> tag inside both if / else, then end at the bottom. The else is the files and the first if is the directory. Only wanted it to apply to files, not folders so you can still traverse.