Hi,
I'm new to php and I would appreciate some help.
When I upload a file to a directory that is in another directory than my upload page, I get this error :
Warning: move_uploaded_file(GaragePoolers/uploads/a2.jpg): failed to open stream: No such file or directory in /home/peter/public_html/GaragePoolers/database/admin_toevoegen_auto.php on line 124
Warning: move_uploaded_file(): Unable to move '/tmp/phpHrvwXm' to 'GaragePoolers/uploads/a2.jpg' in /home/peter/public_html/GaragePoolers/database/admin_toevoegen_auto.php on line 124
Warning: chmod(): No such file or directory in /home/peter/public_html/GaragePoolers/database/admin_toevoegen_auto.php on line 125
Can't chmod
When I upload the foto to a map in the same directory as my upload page, there is no problem.
This is the code I'm using :
move_uploaded_file($FILES[foto2][tmp_name], "uploads/".$FILES[foto2][name]);
if(!chmod(dirname($SERVER['SCRIPT_FILENAME'])."/uploads/". $FILES[foto2][name],0777))
{echo "Can't chmod $file";}
Anybody knows why this is ?
Thank You
Peter