My current directory structure is as follows:
C:\xampp\htdocs\PHP_Upload_Image_MKDIR
In other words, the following directories do NOT exist at all.
C:\xampp\htdocs\PHP_Upload_Image_MKDIR\uploaded
C:\xampp\htdocs\PHP_Upload_Image_MKDIR\uploaded\s002
The problem is that when I run the following script, the is_dir function always returns TRUE.
Based on the manual http://us2.php.net/manual/en/function.is-dir.php
is_dir: Returns TRUE if the file name exists and is a directory, FALSE otherwise.
Did I miss something?
thank
$userID = 's002';
$uploadFolder = '/PHP_Upload_Image_MKDIR/uploaded/';
$userDir = $uploadFolder . $userID;
echo '<br/>$userDir: ' . $userDir . '<br/>';
if ( is_dir ($userDir))
{
echo "dir exists";
}
else
{
echo "dir doesn't exist";
}
mkdir($userDir, 0700);
C:\xampp\htdocs\PHP_Upload_Image_MKDIR>dir /ah
Volume in drive C is System
Volume Serial Number is 30B8-2BB2
Directory of C:\xampp\htdocs\PHP_Upload_Image_MKDIR
File Not Found
C:\xampp\htdocs\PHP_Upload_Image_MKDIR>
//////////////////////////////////////////////////////////
Based on the comments of Artefacto:
Here is the output of C:\PHP_Upload_Image_MKDIR\uploaded\s005
echo '<br/>' . realpath($userDir) . '<br/>';
Thank you for your decision.
Regards
q0987 source
share