Re: protecting downloads with php

From: Date: Sat, 11 May 2002 09:44:52 +0000
Subject: Re: protecting downloads with php
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-97074@lists.php.net to get a copy of this message
-----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-----

« previous php.general (#97074) next »