RE: [PHP-DB] dump data, and save as a file
Header(Content-type: text/plain); Header(Content-Disposition: attachment; filename=topsellers_dvd.csv); Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com Hi everyone, I want to dump some data from mysql into a file, and use php to force the browser to pop a download file window. This seems a simple procedure, but I am having trouble to make it work with IE. The following is what I did: ob_start(); $query = SELECT * FROM table; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { echo $row['data']; } header(Cache-control: private); header(Content-Type: application/txt); header(Content-Disposition: attachment; filename=test.txt); //Note: I also tried: header(Content-Disposition: inline; filename=test.txt); ob_end_flush(); * It seems OK with Netscape, but with IE, all I got is all data displayed on the screen even with ob_start(). I also tried echo the data after header(), I have the same result. I have spent a long time on this, and searched for information on www.php.net, but can not find an answer. Your help is highly appreciated. Thanks in advance. Ruth
Re: [PHP-DB] dump data, and save as a file
On Fri, 2003-02-14 at 03:09, Ruth Zhai wrote: Hi everyone, I want to dump some data from mysql into a file, and use php to force the browser to pop a download file window. This seems a simple procedure, but I am having trouble to make it work with IE. The following is what I did: ob_start(); $query = SELECT * FROM table; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { echo $row['data']; } header(Cache-control: private); header(Content-Type: application/txt); header(Content-Disposition: attachment; filename=test.txt); Did you try with header(Content-Type: application/octet-stream); header(Content-transfer-encoding: binary\n); ? //Note: I also tried: header(Content-Disposition: inline; filename=test.txt); ob_end_flush(); * It seems OK with Netscape, but with IE, all I got is all data displayed on the screen even with ob_start(). I also tried echo the data after header(), I have the same result. I have spent a long time on this, and searched for information on www.php.net, but can not find an answer. Your help is highly appreciated. Thanks in advance. Ruth -- Stephane [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] dump data, and save as a file
Use Content-Type: application/octet-stream Gary Every [EMAIL PROTECTED] wrote: Header(Content-type: text/plain); Header(Content-Disposition: attachment; filename=topsellers_dvd.csv); Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com Hi everyone, I want to dump some data from mysql into a file, and use php to force the browser to pop a download file window. This seems a simple procedure, but I am having trouble to make it work with IE. The following is what I did: ob_start(); $query = SELECT * FROM table; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { echo $row['data']; } header(Cache-control: private); header(Content-Type: application/txt); header(Content-Disposition: attachment; filename=test.txt); //Note: I also tried: header(Content-Disposition: inline; filename=test.txt); ob_end_flush(); * It seems OK with Netscape, but with IE, all I got is all data displayed on the screen even with ob_start(). I also tried echo the data after header(), I have the same result. I have spent a long time on this, and searched for information on www.php.net, but can not find an answer. Your help is highly appreciated. Thanks in advance. Ruth -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php