Reply
need help to limit downloads
Old 08-02-2004, 10:56 PM need help to limit downloads
bbp3d-samson's Avatar
Junior Talker

Posts: 3
Location: canada
Hello...
I need help to try to limit the amount of files a user can download from my site per day .

For bandwidth reasons i only want to allow 2files/user/day
I thought about cookies , but all ya do is clear your cookies and come back ,, i need something better .

Any ideas will be great.
thanks-- bbp3d
bbp3d-samson is offline
Reply With Quote
View Public Profile Visit bbp3d-samson's homepage!
 
When You Register, These Ads Go Away!
Old 08-03-2004, 12:26 AM
theJack's Avatar
Experienced Talker

Posts: 46
Are users anonymous, or do they have to log in to download the files?
__________________
-theJack
theJack is offline
Reply With Quote
View Public Profile Visit theJack's homepage!
 
Old 08-23-2004, 05:14 PM
spudge's Avatar
Skilled Talker

Posts: 77
Location: Kirkland, WA
You could always store the user's IP and the last date they downloaded something in a database, like this:

IP Date Restricted
1.2.3.4 8/23/04 False

When they download, the code should check to see whether or not their IP is in the database.


If it is in the database, it should check to see if the date of their last download (Date) is today...

If it is today, Restricted should be set to True, and their download should be allowed.

If restricted is already set to true, but the date is not today, the restricted should be set to false, and the date should be set to today, and the user should be allowed.

If the user is not in the database at all, Date should be set to today, and restricted to false.

If you implement that algorithm it should allow 2 downloads per IP per day. The only time this could cause a problem, is if someone is using a Proxy, or NAT and someone using the same proxy or router has already downloaded 2 times. That would lock them out. But either way you're saving bandwidth.

If users aren't anonymous, and have user names you could always store their user name instead of their IP in the database.
spudge is offline
Reply With Quote
View Public Profile Visit spudge's homepage!
 
Old 08-23-2004, 05:54 PM
afonseca's Avatar
Average Talker

Posts: 17
I have done it tracking the login of each user...when they click download I start a counter in the db. If they have already downloaded their quota, I just don't show the download links, which are random...
I clear the counter every morning...

HTH
afonseca is offline
Reply With Quote
View Public Profile
 
Old 08-26-2004, 11:59 AM
melfan's Avatar
Skilled Talker

Posts: 90
I agree with @afonseca the only way you can limit your users to a certain number of downloads is to create a registration page and only members can download the file. Create a counter field that will hold the member's download count and increment it everytime he/she download the file. You cannot rely on IP restrictions because he can use other PC to download the file.
melfan is offline
Reply With Quote
View Public Profile Visit melfan's homepage!
 
Old 09-28-2004, 07:35 PM
babis's Avatar
Junior Talker

Posts: 1
Hi I am also interested in limiting the amount of MB and / or the number of files a user can download from my website in a per-day basis. I am running linux / apache / php / mysql on my server and I have a folder with a large amount of .zip / .rar files for users to download.Yet, due to bandwidth problems I want to put some restrictions, for example 50 MB / day or 10 files. I am looking for a ready to use php script (preferably free / GPL) that would do the job, any suggestions ? thank you !
babis is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to need help to limit downloads
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.26235 seconds with 12 queries