RE: [PHP] PHP Coding HELP
| From: | John W. Holmes | Date: | Fri, 22 Nov 2002 01:23:55 +0000 |
| Subject: | RE: [PHP] PHP Coding HELP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125542@lists.php.net to get a copy of this message | ||
> Users can upload their files, but the files they upload can only be
> downloaded X amount of times. After they've been downloaded so many
times
> in
> an ideal world they'd be automatically removed, though just to be made
so
> people couldn't download them anymore would be great.
You need a download manager.
This can be a simple PHP script. You simply route all of your download
requests to a URL like
download.php?fileid=45
download.php will grab the $fileid and look in a database or file to see
how many times fileid 45 has been downloaded. If it's below your
threshold, then download.php will send the appropriate headers for the
file that's requested, and then send the data of the file. Store the
files outside of the web root for the best protection. If the file has
already been downloaded X times, then just show an HTML page that says
the limit is up.
---John Holmes...