title: Directory set-up for online file storage service
body: <p>I'm developing an online file storage service in mainly PHP and MySQL, where users will be able to upload files up to 10 - 20 GB in size.</p>
  
  <p>Unregistered users will be able to upload files but not in a personal storage space, just a directory where all file uploads of unregistered users will be stored.</p>
  
  <p>Registered users will get a fixed amount (that might increase in the future) of personal storage space and access to a file manager to easily manage and organize all their files. They'll also be able to set their files private (not downloadable by anyone but themselves) or public.</p>
  
  <hr>
  
  <p><strong>What would be a good possible directory set-up?</strong></p>
  
  <p>I'm thinking about a "personal" directory that will contain folders with the user's id as the folder name for each registered user.</p>
  
  <p>Alongside the personal directory, there will be an "other" folder which will just contain every file that's been uploaded by unregistered users.</p>
  
  <p><strong>Both</strong> will contain uploaded files, with each their corresponding row id (from the files table in the database) as the file name.</p>
  
  <pre><code>ROOT
    FOLDER uploads
      FOLDER personal
        FOLDER 1
          FILE file_id1
          FILE file_id2
               (...)
        FOLDER 2
          FILE file_id3
          FILE file_id4
               (...)
          (...)
      FOLDER other
        FILE file_id5
        FILE file_id6
             (...)
  </code></pre>
  
  <hr>
  
  <p>This is the first time I'm dealing with a situation like this, but this concept is all so far what I could came up with. Any suggestions are also welcome!</p>