CGI download CSV

bromden bromden at gazeta.pl
Sun Nov 10 07:23:50 EST 2002


> My Python CGI program generates a .CSV file and I would like Windows
> users to be able to download it via their web browser.

i think, the most simple way to do this is to make the
cgi script write the csv file somewhere under the webroot,
and then return normal html page with a link to this file

eg.
you write csv to /var/www/html/csv/a.csv
and script returns a page with link: http://hostname/csv/a.csv
(where the webroot is /var/www/html)

you can also include in header of the page the line
<meta http-equiv="Refresh" content="1; url=http://hostname/csv/a.csv">
so the download will start automatically (after 1 second)

-- 
bromden
GCS d- s+: a- C++$ UL(++++) P-- L++ E--- W+(++) N++ o? K? w(++) !O M--
!V PS+ PE++ Y+ PGP+ t--- 5? X- R- tv-- b++>+++ DI- D- G e+++ h-- r- y?




More information about the Python-list mailing list