mina S asked:
I have a website that users with login information can upload their files. I want only the user who uploaded the file can have access to that file. I’m using PHP.
I have a website that users with login information can upload their files. I want only the user who uploaded the file can have access to that file. I’m using PHP.


3 Comments to 'PHP Problem: How can i personalize the uploaded files by users on my website?'
March 16, 2010
track in a database what user uploaded what file.
when you display the list of files to the user only show the files based on the records in the database that are associated to the user.
March 17, 2010
just follow the steps:
1) collect the file name,file type and file full path(uploaded path) and all necessary details to database table with member ID
2)Organize the uploaded files in uploads directory with corresponding member ID ( Ex: uploads/12). if you want to more specific try it as
uploads/12/purpose1/ , uploads/12/purpose2/ etc..
3) do not forget to make configuration variables like where to store(absolute path and http path) ,upload directory etc..
March 19, 2010
Here is possibility to do it:
1. Create a field on the uploaded file table, that you can name it UserId
2. Insert the UserId when the user it’s uploading the file.
3.Make a query on page you wanna show the uploaded files, to show only the files that have UserId with the one that is for the user logged.
Leave a comment