Re: [PHP] temp file help

2001-04-17 Thread Joe Stump

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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] temp file help

2001-04-17 Thread Phil Driscoll

Instead of:
header("Content-disposition: filename=backup.csv");
try
header('Content-Disposition: attachment; filename=backup.csv');

Cheers
-- 
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] temp file help

2001-04-17 Thread Randy Johnson

Nope This doesn't work either.   I am going to find header documentation and
see if I can find a work around

-Original Message-
From: Phil Driscoll [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 12:48 PM
To: Randy Johnson; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] temp file help


Instead of:
header("Content-disposition: filename=backup.csv");
try
header('Content-Disposition: attachment; filename=backup.csv');

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]