hi!
I'm having some trouble with this. If i use an ftp address out of some
reason I'm unable to read the file(although I get a handle).(ftp server
supports passive mode)
And if I use http(without authorisation) the browser still asks if I want to
save it.(even if I use video/mpeg as Content-Type) and still displays the
name of my php script instead of the mpeg when asking what I want to do. If
I choose save it then displays the right filename.
Thanks
Thorsten
Mukul Sabharwal <[EMAIL PROTECTED]> schrieb in im Newsbeitrag:
[EMAIL PROTECTED]
> Hey,
>
> Well sure there is:
>
> $fp = fopen($filename, 'r') or die('damn');
> $read = fread($fp, filesize($filename)) or
> die('damn');
> $filestr = basename($filename);
>
> header("Content-Disposition: attachment;
> filename=$filestr");
> header("Content-Type: application/octet-stream");
>
> echo $read;
> exit;
>
> Neat And Clean!
>
> Your authentication can be done above that piece of
> code, you then open the file, read it through send the
> filename download as $filestr, and the contents
> $read.
>
> Simple!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]