Nick Wilson wrote: > Does anyone know of somewhere that lists content-type's? > > Many thanks :-) > - -- > Nick Wilson // www.explodingnet.com >
See http://www.ietf.org/rfc/rfc2183.txt for handling file types in headers. Also see the PHP manual http://www.php.net/manual/en/function.header.php and http://www.php.net/manual/fi/function.fpassthru.php You can download your own copy of the PHP manual from http://www.php.net/download-docs.php and a Windows help version from http://weblabor.hu/php-doc-chm/ All the best, Steve Overall ----- Original Message ----- From: "Nick Wilson" <[EMAIL PROTECTED]> To: "PHP-General" <[EMAIL PROTECTED]> Sent: Saturday, May 11, 2002 2:44 AM Subject: Re: [PHP] protecting downloads with php > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > * and then Miguel Cruz declared.... > > > I use an class to handle all the auth stuff and each page checks the > > > value of $obj->logged_in :: No problem. > > > > > > but what if someone links to www.thesite/theProtectedArea/file.tar.gz > > > > > > that file cannot check if the downloader is logged in can it. > > > > download.php: > > > > <? > > > > if (userIsAuthorized) > > { > > header('Content-Type: application/x-gzip'); > > readfile('secret-name-of-file.tar.gz'); > > exit; > > } > > else > > { > > print 'You are not authorized to download this file.'; > > } > > > > ?> > > Fantastic, so simple! > Does anyone know of somewhere that lists content-type's? > > Many thanks :-) > - -- > Nick Wilson // www.explodingnet.com > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (GNU/Linux) > > iD8DBQE83OgUHpvrrTa6L5oRAkdEAJ4wwvkgfRAXYNqg+Cf4uuwZDz8mOACdE091 > do6OoY5f2HoTiRM3sGGFSeQ= > =Cirg > -----END PGP SIGNATURE----- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php