got it!! :)

$filename = "backup.tar";
$download_file = "/absolute/path/backup.tar";
$fh = fopen("$download_file", "r");
header("Content-Type: application/x-tar");
header("Content-Disposition: attachment; filename=$filename");
fpassthru($fh);
exit();

Thanks a lot!! :)

"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Either of these options will work fine.  There was MASSIVE disscussions
> about this a few weeks back -- check for threads started by myself in the
> archives.
>
> Justin French
>
>
>
>
> on 26/06/02 12:35 AM, Francis ([EMAIL PROTECTED]) wrote:
>
> > I want to protect files from being downloaded and only allow people to
> > download files which they have access too. I've done all the access
control
> > etc... but whats the best way for the user to download the file... Can
you
> > "paste" the file directly into the header? (get the file from the
> > filesystem, mime encode it and put it in the header?) or copying the
file to
> > a web viewable temp dir to allow the user to download it? (dont really
want
> > to do this).
> >
> > Thanks
> >
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to