downloading xls files corrupts them

From: Date: Mon, 12 Jan 2009 19:13:25 +0000
Subject: downloading xls files corrupts them
Groups: php.general 
Request: Send a blank email to php-general+get-286120@lists.php.net to get a copy of this message
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.

« previous php.general (#286120) next »