Re: temp file help

From: Date: Tue, 17 Apr 2001 19:26:30 +0000
Subject: Re: temp file help
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-49030@lists.php.net to get a copy of this message
This is a wonderful IE "feature" - it just tries to open everything regardless of the browser type. I'd be interested in any working workarounds for this. I've even sent my own type headers ... all to no avail. --Joe On Mon, Apr 16, 2001 at 03:30:30PM -0700, Randy Johnson wrote: > 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; > } > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net /* Joe Stump * Sr. PHP Developer * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net */

« previous php.general (#49030) next »