I am creating a game currently and I want users to be able to upload their save games to my site for them to retrieve later, like if they log into another computer or accidentally delete their save from their computer. I want the file to be linked to the specific user that uploaded it, which is easy to do. I have a MySQL database set up that stores the usernames and passwords. The way I think I am going to link the file to the user is to upload the file with its name the same as the username. My problem is I don't want the files to be able to be accessed without being the owner of the file and I don't want them all sitting on my web server taking up more room than is needed. I think a good solution is to zip them up together. What would the easiest way to do that is and be able to retrieve it without unzipping every single file in it to get the one save file. Is it possible to take just one file out of it? I am reading up on the zip functions, http://php.net/manual/en/ref.zip.php. Also, is there a better/easier way of setting each file to a specific "owner"? Thanks!
Edit: I want to both zip and unzip the file(s).