How to set up a limited downlaod, please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CZfrei
Forum Newbie
Posts: 5
Joined: Fri Jul 11, 2008 11:02 am

How to set up a limited downlaod, please

Post by CZfrei »

Is there a way that I can set up a download link that only works a certain number of times? Thanks in advance.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: How to set up a limited downlaod, please

Post by Eran »

Have php handle your downloads (by referring to a script that sends download headers) instead of directly linking to the files. In that script you can implement logging of file downloads (to a file or a database) and deny requests when a cap is reached.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: How to set up a limited downlaod, please

Post by Benjamin »

You may be able to find one that has already been written to save yourself some time.

http://www.google.com/search?q=php+file ... =firefox-a
CZfrei
Forum Newbie
Posts: 5
Joined: Fri Jul 11, 2008 11:02 am

Re: How to set up a limited downlaod, please

Post by CZfrei »

Thanks a lot, this really helps me out.
CZfrei
Forum Newbie
Posts: 5
Joined: Fri Jul 11, 2008 11:02 am

Re: How to set up a limited downlaod, please

Post by CZfrei »

One more quick question if someone can answer it. Will that work if I have different users? So that I limit each user to a certain amount of downloads.
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: How to set up a limited downlaod, please

Post by Zoxive »

If you make it that way it will.
Post Reply