Forum Moderators: phranque

Message Too Old, No Replies

¿.htaccess to limit picking up to certain quantity of files?

How to give permission for picking up a maximun 10 files

         

ceglobal

7:28 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



Dear friends,

I want to give permission for picking up a maximun 10 files/day (jpg, pdf, or doc) of an especific folder in my website.

Nowadays the .htaccess file is simply like that:

order allow,deny
allow from all
deny from xx.#*$!.xx.xx

Also, how to inform people that has been crossed this limit.

Thank you all a lot,

Maria

jdMorgan

12:18 am on Jun 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This will require that you identify your visitors by username or by IP address, and create and maintain a database containing the user data, current file download count, and timestamp of each previous successful request within the current timing cycle. You will then need to check the number of files downloaded in the previous 24 hours, and determine if they are above the limit. If that is the case, then they should be presented with a special page when they attempr to download more files.

This is well beyond the capabilities of .htaccess alone. I would suggest using mysql and php or perl to create a scripted solution, or searching for ready-made solutions you might be able to buy.

Jim