I have my project link as follows : http://localhost/prolist_admin/
and I use the move_uploaded_file as follows move_uploaded_file($temp_name, "../assets/img/static/$projectLogo");
The above code moves my file to the right folder, with the permission set to 777 on that folder.
Now, I want to move the files to a different folder, not the project folder.
for this, I’m having a hard time using ../../../
to navigate there( I don’t think it’s a good idea either)
Is there a way I can just use something like the following absolute linking http://localhost/newFolder/$projectLogo
to move the files to a brand new folder, outside the project folder?
Thanks!
2
Answers
https://www.php.net/manual/en/function.realpath