I know this has been addressed before, but I'm wondering if anyone has ever found a 
solution.

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']);


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.  BTW, after doing some research I changed this:
        header('Content-Disposition: attachment; filename="' .
           $file_info['filename'] . '"');
to this:
        header('Content-Disposition: filename="' .
           $file_info['filename'] . '"');

but it did not help.  I've also tried several other iterations of the above to no 
avail.

Problem #2:  if I change the first header to:
        header('Content-Type: application/force-download');

a save-as dialog box comes up, but it does not carry-through the file name of the file 
being downloaded - instead it sets the default file name to the name of the script 
that's being executed (i.e. download_file.php).

Any help is, as always, greatly appreciated.
-- 

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

Reply via email to