SarahB12 Posted May 13, 2010 Share Posted May 13, 2010 Hey guys! I am looking to secure some (pdf, doc, xls) files in a folder on my site. The problem is I don't have the option of .htaccess which is how I typically secure these files. I also would like to avoid .Net (web.cofig) since all of my pages are coded in php. Are there any other options for securing a folder using php/mysql? I have searched online, but I cannot find any resources for php security of folders. Thanks! ~SarahB~ Link to comment https://forums.phpfreaks.com/topic/201633-php-security-of-folder/ Share on other sites More sharing options...
Psycho Posted May 13, 2010 Share Posted May 13, 2010 You should put the files in a folder that is not accessible through the web, i.e. not in the web root. You can then build a PHP front-end interface to allow a user to authenticate and request the files. PHP can then "read" the documents from the server-side and serve them to the user. Example: | |-Web Root | | | |-images | |-css | |-html files | |-php scripts | |-Secured documents Link to comment https://forums.phpfreaks.com/topic/201633-php-security-of-folder/#findComment-1057740 Share on other sites More sharing options...
SarahB12 Posted May 14, 2010 Author Share Posted May 14, 2010 Thanks for the suggestion mjdamato! I was able to find a resource that worked for me! ~SarahB~ You should put the files in a folder that is not accessible through the web, i.e. not in the web root. You can then build a PHP front-end interface to allow a user to authenticate and request the files. PHP can then "read" the documents from the server-side and serve them to the user. Example: | |-Web Root | | | |-images | |-css | |-html files | |-php scripts | |-Secured documents Link to comment https://forums.phpfreaks.com/topic/201633-php-security-of-folder/#findComment-1058310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.