I have a Python CGI script script.py
running on a server. It produces a CSV file as output.
I want computer-inexperienced people that don't know about file extensions to be able to just save the file to their hard drive and use it by double-clicking.
The problem: If they now click "OK" in the save dialog of the browser, the saved file's name is script.py
, instead of script.csv
.
How can I set some sort of "default filename" from within the CGI? Maybe some HTTP header trickery? I don't have access to the server configuration.