Forums.ATC.no

Teknisk => Generelt teknisk => Emne startet av: ATC på 27. ſeptember 2008, 18:24 pm

Tittel: How to write a CGI script that generates a semicolon separated file
Skrevet av: ATC27. ſeptember 2008, 18:24 pm
When generating web content on-the-fly, the standard HTTP header used is "Content-type: text/html". However, this means the user has to actively click "File" and "Save as..." to get a file save dialogue. Furthermore, the default filename is the same as the CGI script filename.
Tittel: [Solved] How to write a CGI script that generates a semicolon separated file
Skrevet av: ATC27. ſeptember 2008, 18:24 pm
Use the following HTTP header instead:

Content-type: application/octet-stream
Content-Disposition: attachment; filename="filename.ext"


This will cause most browsers to pop up the file "Save as..." dialogue automatically. Note that you may NOT specify a path.