i have a php web app used by several users. They can upload files in a directory : "files" a sub directory is created with the unique name given to the user "foo" and the file is stored, so: mydomain.com/files/foo/thefilename.doc
It works but to prevent direct access to the file and to prevent others users to access a file they don't belong, i placed a .htaccess file with:
Order Deny,Allow
Deny from all
It works BUT, in my web app if the user "foo" want to access and display his files, he receive a 403 error.
How can i do (like an EDM Electronic Document Management) to store files prevent direct access but give access to the right user?
Thanks a lot