i got a little script here that generates me an json out of my webform, this works very well. now i want to change the script so the file is saved in a new directory, named as my projectname. at the moment it generates the folder with all the permissions, but the file is still not saved in it, maybe there is just a little failure. can you figure out whats wrong?
$json = json_encode($info, JSON_NUMERIC_CHECK);
mkdir('../uploads/'.$projectname, 0777 , true);
chmod('../uploads/'.$projectname, 0777 , true);
$save = fopen('../uploads/'.$projectname, $projectname . ".json", "w");
fwrite($save, $json);
fclose($save);
the file and the directory should be named after the project
thanks