I have A PassKit PHP Script And The rename() And mkdir() wont work. What Am I Doing Wrong?

108 Views Asked by At

I have a php system that will sign and zip a passbook pass. I need it to check for the file thumbnail.png and if it does not exist to make a directory with the variable $idnumber and then rename the file and move it over into the new folder. This Is My Code:

...

if (!file_exists('images/'.$idnumber.'/thumbnail.png')) {
mkdir("images/$idnumber", 0777);
rename("images/$idnumber.png", "images/$idnumber/thumbnail.png")
}

$pass->addFile('images/icon.png');
$pass->addFile('images/[email protected]');
$pass->addFile('images/logo.png');
$pass->addFile('images/'.$idnumber.'.png');
if($pass->checkError($error) == true) {
exit('An error occured: '.$error);
}
...

I Am Running This Code On A XAMPP LocalServer, but it is not creating the directory or renaming file.

What Am I Doing Wrong?

0

There are 0 best solutions below