note 11622 added to header

From: Date: Tue, 27 Feb 2001 22:22:18 +0000
Subject: note 11622 added to header
Groups: php.notes 
Request: Send a blank email to php-notes+get-11646@lists.php.net to get a copy of this message
if you make a download with the suggested header directives you won't be able to open the file directly (well not without clicking on open for 3 times) but would have to download it. here's what we did to make a csv-download without the disturbing 'do-you-want-to-open-or-save-the-file-dialogs': we added a line in the httpd.conf of the apache-server and made csv-files being processed by the php-module. add the following in the according virtual-host directive (or if you dare for the whole server). <VirtualHost your-ip-address> ServerName your-host-name DocumentRoot your-app-path # this is for the file downloads AddType application/x-httpd-php .csv </VirtualHost> then we renamed the php-file that generated the csv-content to 'download.csv' and made a link to it from another page http://www.php.net/manual/en/function.header.php

« previous php.notes (#11646) next »