Neptunus Maris Posted January 4, 2008 Share Posted January 4, 2008 Hi peoples...I'm trying to figure out why I can't view a fdirectory when I make a new directory and copy files over to it. I get a Forbidden Access error. Someone suggested umask() function and I also checked it out on php.net So...for example would this work to create a new directory, copy files over to it and then go in that directory and view files, using the umask function...even if you execute it in the directory you are already in but not the new one?: <?php $newDir = $_POST[new_dir]; umask(0755); mkdir($newDir); //now copy it from some other directory up one level from the current directory $filename = "../myfilename.php"; //lets just say its a php or an html web file. copy($filename, $newDir); //redirect if you want header("Loction: $newDir/myfilename.php"); exit; ?> Now does that work? ??? Quote Link to comment https://forums.phpfreaks.com/topic/84392-umask/ Share on other sites More sharing options...
phpSensei Posted January 4, 2008 Share Posted January 4, 2008 What? Get a FTP client tool, and change the CHMOD properties. Quote Link to comment https://forums.phpfreaks.com/topic/84392-umask/#findComment-429860 Share on other sites More sharing options...
Neptunus Maris Posted January 4, 2008 Author Share Posted January 4, 2008 What? Get a FTP client tool, and change the CHMOD properties. No I'm just talking about general folder making and permissions setting without having to set them everytime over and over again. Do it once with some function. Quote Link to comment https://forums.phpfreaks.com/topic/84392-umask/#findComment-429864 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.