I have a problem with mkdir()
function.
In my website first time user can login add photos mkdir()
working and same user second time upload images:
Warning: mkdir(): File exists.
Message can display I will check all the formats in mkdir no one is working.
My code looks like:
$folder="users/$aid/projects/$prname/";
if(!file_exists($folder) && is_dir($folder)) {
$path = mkdir("$folder/images", 0777, true);
}
Fist time user visit this page directory created but second time upload images it is not working above error will display.
Remain Content also not saved in database.
First time user can visit images folder created. Second time also user visit that page upload images problem is occurring.
Can you try it as follows? First we need to check if the folder exists.
$folder="users/$aid/projects/$prname/";
if(!is_dir($folder))
mkdir("$folder", 0777, true))
if (!is_dir($folder."/images"))
$path = mkdir("$folder/images", 0777, true);