AW: [PHP] downloading files
| From: | Sebastian Stadtlich | Date: | Mon, 11 Dec 2000 17:25:18 +0000 |
| Subject: | AW: [PHP] downloading files | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-29713@lists.php.net to get a copy of this message | ||
as far as i know : this won't work if you run PHP in safemode
:-[
> -----Ursprüngliche Nachricht-----
> Von: Ignacio Vazquez-Abrams [mailto:ignacio@openservices.net]
> Gesendet am: Montag, 11. Dezember 2000 18:12
> An: Deepak Chawla
> Cc: php-general@lists.php.net
> Betreff: Re: [PHP] downloading files
>
> On Mon, 11 Dec 2000, Deepak Chawla wrote:
>
> > Hi!
> > is there a way in which i can allow users to download files
> from my site
> > without letting them know the location on the file on my
> server ?? i'm
> > using html+javascript on the client side and php on the server side.
> >
> > thanks
> >
> > -deepak
> >
>
> Just use a database or array to hold a map, e.g.:
>
> file1.txt => (/docs/text/file1, text/plain)
> file2.pdf => (/docs/file2.pdf, application/x-pdf)
> ...
>
> Then use header() to set the content type and readfile() to
> dump the file
> passed as a GET parameter (e.g.,
> http://www.example.com/file.php3?file=file1.txt).
>
> --
> Ignacio Vazquez-Abrams <ignacio@openservices.net>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>