temp file help

From: Date: Mon, 16 Apr 2001 22:30:30 +0000
Subject: temp file help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49028@lists.php.net to get a copy of this message
The following code downloads information on the fly and saves it as a file on the user's hard drive. It works great in Netscape downloads data properly but in Internet explorer it doesn't work. Here is the error I get any ideas? IE was not able to open this site the site is either unavailable or cannot be found. BUT if I right click and says "The file cannot be written to cache". I even commented out the following: header("Pragma: no-cache"); But it still did not work. Please help !!! Thanks Randy include "db.inc"; header("Content-disposition: filename=backup.csv"); header("Content-type: application/octetstream"); header("Pragma: no-cache"); header("Expires: 0"); // doing some DOS-CRLF magic... $client=getenv("HTTP_USER_AGENT"); if (ereg('[^(]*\((.*)\)[^)]*',$client,$regs)): $os = $regs[1]; // this looks better under WinX if (eregi("Win",$os)): $crlf="\r\n"; else: $crlf="\n"; endif; /* OS = WIN */ endif; /* ereg $client */ #################### # DB STATEMENT HERE ##################### $link_id = db_connect($default_dbname); if(!$link_id) error_message(sql_error()); $result = mysql_query($query)or print "error".mysql_error(); if(!$result) error_message(sql_error()); while($query_data = mysql_fetch_array($result)) { Variable definition/and assignment here echo "var1,var2,var3,var4,var5,var6"; echo $crlf; }

« previous php.general (#49028) next »