hey people,
I'm trying to create 3 folders at once if they don't already exist.
the path I want to create is:
userfiles/username/BigImages/
My code is as follows:
$mkBigImagePath = '/userfiles/'.$username.'/BigImages';
//Set up directory if it doesn't exist
if (!is_dir($mkBigImagePath)) {
if (!mkdir($mkBigImagePath))
die ("$mkBigImagePath directory doesn't exist and creation failed");
if (!chmod($mkBigImagePath,0755))
die ("change permission to 755 failed.");
}
The error/warning I get is:
mkdir(/userfiles/USERNAME/BigImages) [function.mkdir]: No such file or directory
I've tried different values for $mkBigImagePath i.e. removing and adding the slashes, trying back slashes etc.
Does anyone know why it won't let me do this?
I am able to create ONE folder in the same directory that the code is being run, I just can't seem to make the sub folders.
Thanks.