Re: Excel headers not working anymore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Perry, Matthew (Fire Marshal's Office) wrote:
Good morning,

I have been using PHP4.1, Apache, and MySQL for a few years now and have
never had a problem with my Excel headers.  When I want to output html to
Excel I place the following on the top of the page:

<?header ("Content-type: application/vnd.ms-excel");
header ("Content-Disposition: attachment" );

After moving to PHP 4.3, MS SQL Server, Windows 2000 Server I am having
problems with this header.  I get the message:
"Internet Explorer cannot download myfile.php from myintranet.net"

1) is your server still configured to recognize "<?" as php (and only php)? You may want to make that "<?php" to be more sure. The headers likely aren't being sent if it's prompting to download .php - seems like it's not recognizing the extension, perhaps it's disabled for a certain pattern.
You could also try changing it to:


header("Content-disposition: attachment; filename=\"$filename\"");

to ensure that it's "going off" (set $filename obviously, something distinct like my_excel.xls)


2) Are you using ssl and sessions? You'll find some fun and strange behavior trying to save output from an ssl connection and sessions - because sessions force no-cache, and (IE in particular) has real issues with storing the output of a no-cache'd https - you can't save it locally or open with an external application, because either way it has to store it somewhere other than memory, which would be caching.


Cheers,
--
- Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital.


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux