Re: download function
| From: | Ignatius Reilly | Date: | Mon, 01 Sep 2003 08:37:07 +0000 |
| Subject: | Re: download function | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-21295@lists.php.net to get a copy of this message | ||
I found the solution to my problem.
Sorry
Ignatius
_________________________
----- Original Message -----
From: "Ignatius Reilly" <ignatius.reilly@free.fr>
To: "Win32 list PHP" <php-windows@lists.php.net>
Sent: Saturday, August 30, 2003 1:19 PM
Subject: [PHP-WIN] download function
> 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
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>