I have a site with user logins and sessions. I'd like to allow my users to upload files to the webserver, but only have them available for their login.
I understand if I upload to some sort of public web directory that the file would be still accessible via:
http://www.mydomain.com/files/thefile.pdf
However, I'm thinking I can store the files in the directories just above my public HTML root (say it's /mnt/content/web/html).
So, I could make a directory called (/mnt/content/web/uniqueidfortheuser) and store my files there, then reference the files via PHP with the syntax:
(../uniqueidfortheuser/thefile.pdf).
My question - is this secure enough or is there something I'm overlooking? The name of the uniqueidfortheuser would be stored in a database and unknown to users, and they'd have to have a valid session to gain access the their unique name of their folder. And I don't think they'd be able to call any of the files in the folder from the web.