falcondriver
Mar 20th 2006, 8:26 am
hi,
i hope someone can help me, could not find an helpfull answear in other places - not even on php.net .
i have a folder /images/ (owner "web66", 777), and i want to create new folders inside and upload pictures into this new folders via php - thats all! currently it looks like its easier to fly to the moon and back than creating a folder with different permissions on a shared webserver.
here is my code to create and upload files:
<?php
if(!file_exists($uploaddir)) {
mkdir($uploaddir, 0777);
chown($uploaddir, "web66");
}
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
...
?>
and here is what i get:
Warning: chown(): Operation not permitted in /home/www/web66/html/test.php on line 45
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 746 is not allowed to access /home/www/web66/html/images/tmp_testdir owned by uid 33 in /home/www/web66/html/test.php on line 47
any ideas...?
i hope someone can help me, could not find an helpfull answear in other places - not even on php.net .
i have a folder /images/ (owner "web66", 777), and i want to create new folders inside and upload pictures into this new folders via php - thats all! currently it looks like its easier to fly to the moon and back than creating a folder with different permissions on a shared webserver.
here is my code to create and upload files:
<?php
if(!file_exists($uploaddir)) {
mkdir($uploaddir, 0777);
chown($uploaddir, "web66");
}
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
...
?>
and here is what i get:
Warning: chown(): Operation not permitted in /home/www/web66/html/test.php on line 45
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 746 is not allowed to access /home/www/web66/html/images/tmp_testdir owned by uid 33 in /home/www/web66/html/test.php on line 47
any ideas...?