[PHP] RE: Mac IE File download problem - any solutions?

2003-03-26 Thread Philip Hallstrom
You might try...

header(Content-Disposition: attachment; filename=$filename);

maybe?

On Tue, 25 Mar 2003, Daniel Leighton wrote:

 Actually, I think you may have misunderstood.  On Mozilla (Mac), Netscape (Mac) and 
 Safari the script works exactly as I have intended: sending the Content-Type: 
 application/octet-stream header causes the file to download; sending the 
 Content-Type: video/quicktime causes the file to be played within the browser.  On 
 IE (Mac OS X), some files with the .mov extension download when the Content-Type: 
 application/octet-stream header is sent, while others play in-browser, while all 
 play in-browser, as they should.

 From what I understand, Content-Type: application/octet-stream header should 
 ALWAYS cause a download.  This is not an issue of post-processing (the settings in 
 the browser which tell it to open a file in a certain application AFTER the file has 
 been downloaded - that is not a problem).  BTW, even if I change my preferences in 
 IE to save .mov files to disk, they still play in-browser.

 After re-compiling PHP with mime-magic enabled, the mime_content_type() function is 
 returning video/quicktime for the file which does not download and text/plain 
 for the one which does (even though the text/plain file plays fine both in-browser 
 and once it is downloaded).  In any case, that will be my next area of investigation.

 At 12:03 PM -0800 on 3/25/03, Jennifer Goodie wrote:


 This is not a MAC IE problem, it is the way browsers work.  If the MIME type
 is mapped to an application, the browser will launch the application.  IE
 does it inline, while Netscape tends to launch it separately.
 
 You can send false headers with a made up type and a missing file extension,
 but then the browser will not know what type of file it is and the save as
 is harder for the user as they have to put the right extension on.  It is a
 work around, but a really poor one.
 
 header(Content-disposition: filename=$filenamewithoutextension);
 header(Content-type:reallyreallyreallybigcsv);
 
 
 
 
 -Original Message-
 From: Step Schwarz [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 25, 2003 11:49 AM
 To: Daniel Leighton; [EMAIL PROTECTED]
 Subject: Re:  Mac IE File download problem - any solutions?
 
 
 [...]
  The problem:  When downloading certain files on a Mac using IE 5.x, files
 are
  displayed within a browser window instead of downloading.  This seems to
 occur
  mostly with quicktime files (.mov, .mp3).  Some quicktime files work,
 while
  others with the same extension do not.
 [...]
 
 Hi Daniel,
 
 I believe this is a browser setting, is it not?  Using the default setup of
 Explorer 5.2 for Mac, a clicked .mov file will play in IE.
 
 To change this behavior, go to Explorer  Preferences...  File Helpers,
 select QuickTime Movie and click Change... then switch Handling from View
 with Browser to Save to File.
 
 I would be surprised if a file header could override this.. but if you find
 a way, please let us know!
 
 -Step
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 --

 Daniel Leighton
 Chief Technology Officer
 Webolution
 http://www.webolution.com

  This email may contain material that is confidential and privileged for the
 sole use of the intended recipient.  Any review, reliance or distribution
 by others or forwarding without express permission is strictly prohibited.
 If you are not the intended recipient, please contact the sender and delete
 all copies.

 --
 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] RE: Mac IE File download problem - any solutions?

2003-03-26 Thread Daniel Leighton
Hi Phillip,

If you see the original message it's already in there (it was snipped out in the 
replies).  Here is the code:

header('Content-Type: application/octet-stream');
header('Content-Length: '. filesize($file_info['full_file_path']));
header('Content-Disposition: attachment; filename=' .
   $file_info['filename'] . '');
header('Connection: close');

readfile($file_info['full_file_path']);

Any other ideas?  Thanks for your help.

Daniel


At 10:09 AM -0800 on 3/26/03, Philip Hallstrom wrote:


You might try...

header(Content-Disposition: attachment; filename=$filename);

maybe?

On Tue, 25 Mar 2003, Daniel Leighton wrote:

 Actually, I think you may have misunderstood.  On Mozilla (Mac), Netscape (Mac) and 
 Safari the script works exactly as I have intended: sending the Content-Type: 
 application/octet-stream header causes the file to download; sending the 
 Content-Type: video/quicktime causes the file to be played within the browser.  
 On IE (Mac OS X), some files with the .mov extension download when the 
 Content-Type: application/octet-stream header is sent, while others play 
 in-browser, while all play in-browser, as they should.

 From what I understand, Content-Type: application/octet-stream header should 
 ALWAYS cause a download.  This is not an issue of post-processing (the settings in 
 the browser which tell it to open a file in a certain application AFTER the file 
 has been downloaded - that is not a problem).  BTW, even if I change my preferences 
 in IE to save .mov files to disk, they still play in-browser.

 After re-compiling PHP with mime-magic enabled, the mime_content_type() function is 
 returning video/quicktime for the file which does not download and text/plain 
 for the one which does (even though the text/plain file plays fine both 
 in-browser and once it is downloaded).  In any case, that will be my next area of 
 investigation.

 At 12:03 PM -0800 on 3/25/03, Jennifer Goodie wrote:


 This is not a MAC IE problem, it is the way browsers work.  If the MIME type
 is mapped to an application, the browser will launch the application.  IE
 does it inline, while Netscape tends to launch it separately.
 
 You can send false headers with a made up type and a missing file extension,
 but then the browser will not know what type of file it is and the save as
 is harder for the user as they have to put the right extension on.  It is a
 work around, but a really poor one.
 
 header(Content-disposition: filename=$filenamewithoutextension);
 header(Content-type:reallyreallyreallybigcsv);
  
  
  
  
  -Original Message-
  From: Step Schwarz [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, March 25, 2003 11:49 AM
  To: Daniel Leighton; [EMAIL PROTECTED]
 Subject: Re:  Mac IE File download problem - any solutions?
 
 
 [...]
  The problem:  When downloading certain files on a Mac using IE 5.x, files
 are
  displayed within a browser window instead of downloading.  This seems to
 occur
  mostly with quicktime files (.mov, .mp3).  Some quicktime files work,
 while
  others with the same extension do not.
 [...]
 
 Hi Daniel,
 
 I believe this is a browser setting, is it not?  Using the default setup of
 Explorer 5.2 for Mac, a clicked .mov file will play in IE.
 
 To change this behavior, go to Explorer  Preferences...  File Helpers,
 select QuickTime Movie and click Change... then switch Handling from View
 with Browser to Save to File.
 
 I would be surprised if a file header could override this.. but if you find
 a way, please let us know!
 
 -Step
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 --

 Daniel Leighton
 Chief Technology Officer
 Webolution
 http://www.webolution.com

  This email may contain material that is confidential and privileged for the
  sole use of the intended recipient.  Any review, reliance or distribution
 by others or forwarding without express permission is strictly prohibited.
 If you are not the intended recipient, please contact the sender and delete
 all copies.

 --
 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


-- 

Daniel Leighton
Chief Technology Officer
Webolution
http://www.webolution.com

 This email may contain material that is confidential and privileged for the
sole use of the intended recipient.  Any review, reliance or distribution
by others or forwarding without express permission is strictly prohibited.
If you are not the intended recipient, please contact the sender and delete
all copies.

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