Re: [PHP] File Download link not working in PHP 4.3.4

2004-03-31 Thread Andrew Hauger
Curt,

Thanks for the suggestions. Unfortunately, no luck
yet. Here's the current version of the affected lines
of code:

$file_type = vnd.ms-excel;
$file_ending = xls;
header ( Content-Type: application/$file_type );
header ( 'Content-Disposition: attachment;
filename=product.'.$file_ending.'' );
header ( 'Expires: ' . date ( 'r', 0 ));

Still getting the same behavior, on both the Windows
and Solaris platforms.

Andy

 From: Curt Zirzow [EMAIL PROTECTED]
 Sent: Tuesday, March 30, 2004 9:56 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] File Download link not working in
PHP 4.3.4
 
 * Thus wrote Andrew Hauger ([EMAIL PROTECTED]):
  the file name. When the OK button is clicked, an
  error dialog pops up with the message Internet
  Explorer cannot download ... [snipped URL].
Internet
  Explorer was not able to open this Internet site.
The
  requested site is either unavailable or cannot be
  found. Please try again later.
 
 This can mean a lot of things, IE tends to be too
friendly
 sometimes.
 
 
  
  Here are the header commands:
  
  $file_type = vnd.ms-excel;
  $file_ending = xls;
  header ( Content-Type: application/$file_type );
  header ( Content-Disposition: attachment;
  filename=product..$file_ending );
 
 Quote the filename, although it most likley wont be
the problem.
 
Conent-Type: attachment; filename=product.xls
 
 
  header ( Expires: 0 );
 
 I might wage this is the problem, it needs to be a
valid HTTP date,
 something like this will do the job:
 
   header('Expires: ' . date('r', 0); 
 
 
 Curt
 -- 
 I used to think I was indecisive, but now I'm not
so sure.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system
(http://www.grisoft.com).
 Version: 6.0.624 / Virus Database: 401 - Release
Date: 3/15/2004

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Download link not working in PHP 4.3.4

2004-03-31 Thread John W. Holmes
Check the comments on this page:

http://us2.php.net/manual/en/function.session-cache-limiter.php

---John Holmes...

- Original Message - 
From: Andrew Hauger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 11:18 AM
Subject: Re: [PHP] File Download link not working in PHP 4.3.4


 Curt,
 
 Thanks for the suggestions. Unfortunately, no luck
 yet. Here's the current version of the affected lines
 of code:
 
 $file_type = vnd.ms-excel;
 $file_ending = xls;
 header ( Content-Type: application/$file_type );
 header ( 'Content-Disposition: attachment;
 filename=product.'.$file_ending.'' );
 header ( 'Expires: ' . date ( 'r', 0 ));
 
 Still getting the same behavior, on both the Windows
 and Solaris platforms.
 
 Andy
 
  From: Curt Zirzow [EMAIL PROTECTED]
  Sent: Tuesday, March 30, 2004 9:56 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] File Download link not working in
 PHP 4.3.4
  
  * Thus wrote Andrew Hauger ([EMAIL PROTECTED]):
   the file name. When the OK button is clicked, an
   error dialog pops up with the message Internet
   Explorer cannot download ... [snipped URL].
 Internet
   Explorer was not able to open this Internet site.
 The
   requested site is either unavailable or cannot be
   found. Please try again later.
  
  This can mean a lot of things, IE tends to be too
 friendly
  sometimes.
  
  
   
   Here are the header commands:
   
   $file_type = vnd.ms-excel;
   $file_ending = xls;
   header ( Content-Type: application/$file_type );
   header ( Content-Disposition: attachment;
   filename=product..$file_ending );
  
  Quote the filename, although it most likley wont be
 the problem.
  
 Conent-Type: attachment; filename=product.xls
  
  
   header ( Expires: 0 );
  
  I might wage this is the problem, it needs to be a
 valid HTTP date,
  something like this will do the job:
  
header('Expires: ' . date('r', 0); 
  
  
  Curt
  -- 
  I used to think I was indecisive, but now I'm not
 so sure.
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  ---
  Incoming mail is certified Virus Free.
  Checked by AVG anti-virus system
 (http://www.grisoft.com).
  Version: 6.0.624 / Virus Database: 401 - Release
 Date: 3/15/2004
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] File Download link not working in PHP 4.3.4

2004-03-30 Thread Andrew Hauger
I have a script that dynamically generates a CSV file
for downloading to MS Excel. The script works fine in
PHP 4.3.3 on a Windows machine using Apache 2, and the
exact same script does not work in PHP 4.3.4 on
Solaris 9 using Apache 1.3.29. A script with
essentially the same header commands works in PHP
4.3.1 on Solaris 9 using Apache 1.3.27. 

The script is supposed to pop up a window to prompt
the user to either open the document from its current
location or save it to disk. On the systems that work,
the window pops up with the expected file name. On the
system that does not work, the window pops up with the
URL for the script that generates the file instead of
the file name. When the OK button is clicked, an
error dialog pops up with the message Internet
Explorer cannot download ... [snipped URL]. Internet
Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be
found. Please try again later.

Here are the header commands:

$file_type = vnd.ms-excel;
$file_ending = xls;
header ( Content-Type: application/$file_type );
header ( Content-Disposition: attachment;
filename=product..$file_ending );
header ( Expires: 0 );
header ( Connection: Keep-Alive );

Thanks in advance for any helpful suggestions.

Andy Hauger

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Download link not working in PHP 4.3.4

2004-03-30 Thread Curt Zirzow
* Thus wrote Andrew Hauger ([EMAIL PROTECTED]):
 the file name. When the OK button is clicked, an
 error dialog pops up with the message Internet
 Explorer cannot download ... [snipped URL]. Internet
 Explorer was not able to open this Internet site. The
 requested site is either unavailable or cannot be
 found. Please try again later.

This can mean a lot of things, IE tends to be too friendly
sometimes.


 
 Here are the header commands:
 
 $file_type = vnd.ms-excel;
 $file_ending = xls;
 header ( Content-Type: application/$file_type );
 header ( Content-Disposition: attachment;
 filename=product..$file_ending );

Quote the filename, although it most likley wont be the problem.

   Conent-Type: attachment; filename=product.xls


 header ( Expires: 0 );

I might wage this is the problem, it needs to be a valid HTTP date,
something like this will do the job:

  header('Expires: ' . date('r', 0); 


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php