You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using ServeFiles to let users download .mp4 files, but browsers start playing the files instead of forcing users to download them. Normally, this is solved by setting the correct mime type, but I'm not sure I understand where to do this. I was able to set mime type for one of my endpoints in one of handlers (unrelated to serving static files), but that's because I had access to http.ResponseWriter. How do I go about it with static files?
The text was updated successfully, but these errors were encountered:
I'm using
ServeFiles
to let users download .mp4 files, but browsers start playing the files instead of forcing users to download them. Normally, this is solved by setting the correct mime type, but I'm not sure I understand where to do this. I was able to set mime type for one of my endpoints in one of handlers (unrelated to serving static files), but that's because I had access tohttp.ResponseWriter
. How do I go about it with static files?The text was updated successfully, but these errors were encountered: