RE: [PHP-GENERAL] downloading files

From: Date: Fri, 09 Jun 2000 15:38:21 +0000
Subject: RE: [PHP-GENERAL] downloading files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-1401@lists.php.net to get a copy of this message
O frabjous day! Callooh! Callay!" He chortled in his joy. Thanks a million. It works great. How is it though, that it works correctly for files of any type even though the Content-type string says: application/vnd.ms-powerpoint? I've tried it so far on plain text, Powerpoint, Word, Acrobat, etc. and it always does it right even though I'm seemingly telling the browser a lie most of the time. Bill At 10:13 PM -0700 6/8/00, Andrew Smith wrote: >Note, the attachment directive is there to force IE to download the file and >not attempt to display it in the browser (IE ignores content-type). So >strictly speaking, you don't need it to just set the filename. Also unless >your doing it for other reasons you don't need to place the file in a temp yes I have other reasons :-( >directory and redirect the browser, you can just read the file from it's >stored location and send it straight to the browser. eg. > ><? > header("Content-Type: application/vnd.ms-powerpoint"); > header("Content-Disposition: attachment; filename=".$file); > readfile($path.$file); >?> --- Bill Rausch, Software Development, Unix, Mac, Windows Numerical Applications, Inc. 509-943-0861 bill@numerical.com

« previous php.general (#1401) next »