I am creating a website , which people can create their own video and can download it from my server.

I want to limit the download count to 10.

So What I am planning is to serve a download file via a php file and update the count of the file to database.If it reaches 10 downloads.I deny the download.

But I guess it consume more resource.Is there any other way possible in linux server such as using htaccess or something like that ? So after a file is accessed 10 times it should be automatically deleted.

EDIT : its not users...any people can use this website for free.