download function
| From: | Ignatius Reilly | Date: | Sat, 30 Aug 2003 11:19:11 +0000 |
| Subject: | download function | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-21280@lists.php.net to get a copy of this message | ||
Hello,
I have the following problem:
I want users to download content that is stored in a private directory, as a
downloadable file.
So I do:
<code>
header( "Content-type: octet/stream" ) ;
header( "Content-Length: ".filesize( $file_path ) ) ;
header( "Content-Disposition: attachment; filename={$filename}" ) ;
header( "Content-transfer-encoding: binary" ) ;
echo "\n" ;
readfile( $file_path ) ;
</code>
Everything works just fine, except that the main IE (5.5) windows underneath
the download box shows a "The page cannot be displayed" error, which I would
just as well replace by
my own content.
How can I do?
Thanks
Ignatius