Re: Offering files from below the webroot
| From: | Ben Duffy | Date: | Fri, 17 Oct 2003 11:31:38 +0000 |
| Subject: | Re: Offering files from below the webroot | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-166447@lists.php.net to get a copy of this message | ||
<?header('Content-Disposition:attachment; filename=nnn.txt')?>
"Ryan A" <ryan@coinpass.com> wrote in message
news:002401c3945c$8d4aaf90$f081aa51@l2zcaxu7emppqh...
> Hi,
> this has been discussed before on the list but am unable to find it on
> http://marc.theaimsgroup.com/?l=php-general
> If anybody can point me to the correct URL or tell me how you did it I
would
> really appreciate it.
>
> Problems simple:
> offer downloads from below the webroot, something like:
> somsite.co/getFile.php?user=a&pas=b&fil=a.something
>
> (a)check if $user with $pas of b is allowed to download a.something
> (because i dont know if its zip,pdf or what)
> if yes....
> (b)open a file save dialog, give him the file
>
> I can do (a)...how to do (b)? I have checked up fpassthru and
readfile...got
> confused and came here :-D, any pointers?
>
> I have also seen some places where the script gives the browser a
gibberish
> url and opens up a save dialog box...this too would help
> eg:
> somsite.co/getFile.php?hshgkhsgk9asds223tgsa
>
> Thanks in advance.
>
> Cheers,
> -Ryan