Markie
Posts: 251
|
| Posted: 01/05/2009, 11:01 AM |
|
I seem to have a problem while creating upload folders. I use this code:
define ("DIRECTORY", "$folder");
do {
$dir = DIRECTORY;
while (!is_dir($dir)) {
$basedir = dirname($dir);
if ($basedir == '/' || is_dir($basedir))
mkdir($dir,1777);
else
$dir=$basedir;
}
} while ($dir != DIRECTORY);
mkdir("uploaded/$folder",1777);
mkdir("username/$folder",1777);
The directories are created without problems, but instead of file attributes 1777 the directories get file attributes 1341 and errors occur when uploading files (permission denied etc.)
What do I do wrong ?
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 01/05/2009, 11:23 AM |
|
Hi Markie
Try losing the leading 1
Try as the mode 0777 instead.
Don't know of you can set the sticky bit from php.
let me know
John
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Markie
Posts: 251
|
| Posted: 01/05/2009, 1:30 PM |
|
Hi John, yep 0777 is the solution !
thanks again
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
|