-3

I've created a small website with PHP and MySQL. The website allows a user to fill in a questionnaire (which is saved in a database) and then an admin person needs to view and then upload results in PDF format so the original person can view them. In fact the admin person can upload multiple PDF's (over time not in one sitting) to give more feed back which need to be accessible to the user.

My question is, what would be the best way to do this? First, should I upload files via PHP or would jQuery or the like be better? Should each person get their own directory? (does it matter if there are 100's of users?) How can I read all the files that pertain to a particular person and then allow them to view/download it?

Thanks in advance!

user1416564
  • 401
  • 5
  • 18

1 Answers1

1

you can use form and php to upload file. If you need validation do it with php (for server side validation) or javascript (for client side validation), i recommend that you do both.

To distingusih between user data, you can use prefix for filename with username or something (ie. user1_file1, user1_file2, user19_file18), since i think it will be messy to create folder for each user.

To give link for user to download just add "location" column to your user database that contain the file path in your server. With this, you can check their username and every file that they upload in your database.

morgan9999
  • 731
  • 1
  • 11
  • 30