Re: downloading xls files corrupts them

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

 



Chris Ditty wrote:
I am using php to download xls files on my server.   When I download them, excel is saying they are corrupted.  They are not corrupted on the server itself.  These are simple xls spreadsheets with no formatting in them.

Here is the headers that I am using for the download.  This is happening in both IE and Firefox.
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=".basename("./bidDocs/".$myFile).";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize("./bidDocs/".$myFile));
readfile("./bidDocs/".$myFile);

Anyone have any suggestions?



MLGW now offers ONLINE BILLING!
To view your bills, receive paperless bills, check payment status and pay online,
go to www.mlgw.com and click on the My Account link.
Enroll today!


This e-mail and any attachments represent the views and opinions
of only the sender and are not necessarily those of Memphis Light, Gas & Water Division, and no such inference should be made.


try removing:
header("Content-Transfer-Encoding: binary");
and see if it works

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux