mkdir() failed: Permission denied
| From: | Phil Powell | Date: | Sat, 28 Sep 2002 19:38:06 +0000 |
| Subject: | mkdir() failed: Permission denied | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-117977@lists.php.net to get a copy of this message | ||
Ok, I am stuck. I am trying to create a folder in the same directory as
process.php and then use move_uploaded_file($FILES['myImage]['tmp_name'])
and it constantly fails:
mkdir() failed (Permission denied)
Here is my code:
<?
$willChangeLayout = 1; $isEmptyLayoutValues = 1;
foreach ($_POST as $key => $val) {
if (strcmp($key, "isDefaultLayout") == 0) $willChangeLayout = 0;
if (!empty($_POST[$key])) $isEmptyLayoutValues = 0;
${"$key"} = $val;
}
// SERVER-SIDE VALIDATION
if ($willChangeLayout && $isEmptyLayoutValues)
header("Location: " . $refURL . "?errorMsg=" . urlencode("Please fill
out
all required fields"));
// FILE UPLOAD HANDLING
$attempt = mkdir("/users/ppowell/web/my/images", 0655);
if (is_uploaded_file($_FILES['myImage']['tmp_name']))
move_uploaded_file($_FILES['myImage']['tmp_name'],
"/users/ppowell/web/my/images/" . $_FILES['myImage']['name']);
?>
Please someone tell me what I'm doing wrong :(
Thanx
Phil