Search code examples
phpfile-uploaddirectoryspecial-foldersfile-location

Displaying files from out of httpdocs location


The files are going to be stored in a folder next to httpdocs. Thus, it will make hard to display those files to internet user. How I'll overcome this problem? I mean, I want to display/serve those files to the users. Probably I need to use some kind of proxy file?

Old one:

-httpdocs\
  -index.php
  -uploads\  <-
     -folder\
        -image.png
        -image3.jpg
     -folderbla\
        -personal.jpg
        -sp.pdf

New one:

-httpdocs\
   -index.php
-uploads\  <----
   -folder\
      -image.png
      -image3.jpg
   -folderbla\
      -personal.jpg
      -sp.pdf

Solution

  • Configure your web server to graft that directory into your URL space, e.g. using Alias with HTTPd.