Jump to content

umask


Neptunus Maris

Recommended Posts

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?  ???

Link to comment
https://forums.phpfreaks.com/topic/84392-umask/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.