Jump to content

Recommended Posts

I have been getting a lot more client requests to protect files.  What is the easiest way to do this. 

So, basically I have tried doing it outside the public directory. There are too many things that cause

issues with this. I haven't been able to get a successfull implementation of this since I started working with this.

 

So I was thinking instead about password protecting a directory that is inside public view, but still get files via PHP.  Is

there a way to setup a password protected directory, then retreive stuff from that directory using PHP.

 

Or, a good way to put them outside the public folder. Everything I have tried to do to get a file to save outside of public view,

has not worked. It always says uploaded but the file is never there. Also, I have verified correct permission for this as well.

Link to comment
https://forums.phpfreaks.com/topic/218031-root-protection/
Share on other sites

Instead of password protecting the directory, just deny it to everyone.  No password request will be sent, it will just deny access.  Being that PHP is the server, it can still access those files with includes.

 

[.htaccess]

order deny, allow
deny from all

 

 

Link to comment
https://forums.phpfreaks.com/topic/218031-root-protection/#findComment-1131462
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.