Im trying to make a file upload system where whenever a file is upload the file goes into a uploads folder set like this uploads/2012/09/{randomhash}/.
To do this i tried the code below.
$hash = RandomString(20);
$upload_path = '../../uploads/'.$year.'/'.$month.'/'.$hash.'/';
if (!is_dir($upload_path))
{
mkdir($upload_path, 0777);
}
For some reason its not working and i have no idea why.
mkdir() has third parameter called
$recursive. Set it totrue.