Menu

Can I set file upload path to non web dir?

Help
Greg
2007-06-15
2013-06-03
  • Greg

    Greg - 2007-06-15

    Hi

    Is it at all possible to set the file upload path to a non web accessible directory for security please, i.e. not under public_html, e.g. in /home/mysite/files/ rather than in a folder under /home/mysite/public_html/

    Thanks

     
    • TNTEverett

      TNTEverett - 2007-06-15

      Yes it is.  It is also possible to password protect the files folder so people can not access it. 

       
    • Greg

      Greg - 2007-06-16

      Sorry for a silly question but how to set the path?

      And also sorry if dumb, if I password protect the files folder will it not stop allowing access to upload files to it? (I have not tried it).  I have password protected the admin folder.

      Thanks

       
      • TNTEverett

        TNTEverett - 2007-06-16

        In the process.php you would have to change every occurance of "files/" to the new path.  The ne path must be a relative path.  For example:
        Form location
        http://www.domain.com/phpformgen/use/testform
        Form files location
        http://www.domain.com/phpformgen/use/testform/files
        Desired files location
        http://www.domain.com/files

        Change "files/" to "../../files/"

        Changing to something below puplic_html is more involved.  Try just password protection first.  If you feel this is not good enough, come back and post again and I will describe how to put the files below this level. 
        Password protection will not effect the process.php file's ability to upload the files. 

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.