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