0

Hey I am currently working on a project and I have the following problem. I have a database that has a hashed name of a file stored in it along with the original name of the file. The files themselves are stored on a server in their hashed name however. So I need (on request), to get each requested file from the server, then rename the file based on the original name of the file that is stored in the database. This would not be hard, however sometimes there can be more than 100 files requested and each file is in a hierarchy that can easily be different like section A

Thank you!

user2158890
  • 19
  • 1
  • 3
  • 1
    This seems like poor architecture. Why are you using a method that requires you to copy and/or rename files each time a user issues a request? – skrilled Apr 16 '14 at 17:54
  • Its actually submission/collection system. In the collection system, teachers will be able to request x assignment from x sections which have x students. The names of the files are stored as hashes for security purposes. – user2158890 Apr 16 '14 at 18:00
  • do the users request to `download` a file? – Lekhnath Apr 16 '14 at 18:00
  • What you just said has absolutely nothing to do with what I expressed initially :p This is poor architecture regardless. Renaming and moving files around should be the last thing on your mind. You can put files outside of the webroot and secure them via a method [like this](http://stackoverflow.com/questions/10834196/secure-files-for-download). You can validate a user is logged in, or verify that particular user has access to that particular file for example, before allowing the download to happen. **It doesn't matter what you name your file if im a man in the middle attacker.** – skrilled Apr 16 '14 at 18:02
  • Skrilled. I think were on different pages here. These files are all stored in separate areas because upon downloading we rename the hashed file names to their original file name (like helloworld.c) then we package up all the separate folders/paths into one organized folder/path, zip it, and return them all for grading. – user2158890 Apr 16 '14 at 18:06
  • Lekhnath. Yes the Teacher will request via a command line request to get the files from x section which encompasses x assignments which encompasses x students – user2158890 Apr 16 '14 at 18:08

0 Answers0