I have a sinatra application that sends a file to the user when they click a file, I don’t want to give an extension, but Sinatra or the browser is giving it “test.html”
attachment("test")
response.write("write test data")
how can I give the file name of test to the user without it getting renamed to test.html
It might be something the browser is doing, based on the MIME type being passed to it by Sinatra.
Extensions are significant on Windows, Mac OS and Linux OSes these days, so that value is helpful for the user and their machine’s OS. Maybe you can improve things by providing a hint about the actual type of content being sent.
Sinatra’s “MIME Types” documentation says: