I have a script that dynamically generates a CSV file
for downloading to MS Excel. The script works fine in
PHP 4.3.3 on a Windows machine using Apache 2, and the
exact same script does not work in PHP 4.3.4 on
Solaris 9 using Apache 1.3.29. A script with
essentially the same header commands works in PHP
4.3.1 on Solaris 9 using Apache 1.3.27. 

The script is supposed to pop up a window to prompt
the user to either open the document from its current
location or save it to disk. On the systems that work,
the window pops up with the expected file name. On the
system that does not work, the window pops up with the
URL for the script that generates the file instead of
the file name. When the "OK" button is clicked, an
error dialog pops up with the message "Internet
Explorer cannot download ... [snipped URL]. Internet
Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be
found. Please try again later."

Here are the header commands:

$file_type = "vnd.ms-excel";
$file_ending = "xls";
header ( "Content-Type: application/$file_type" );
header ( "Content-Disposition: attachment;
filename=product.".$file_ending );
header ( "Expires: 0" );
header ( "Connection: Keep-Alive" );

Thanks in advance for any helpful suggestions.

Andy Hauger

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to