Error using rename function in PHP

I keep getting this error, although the file is still moving to the correct directory. Does anyone know why I am getting this error?

Warning: rename(../Images/uploaded/1162504_56863010.jpg,../Images/uploaded/Portraits/1162504_56863010.jpg) [function.rename]: No error in D:\Data\Websites\wamp\www\StephsSite\PHP\addImage.php  on line 21
+3
source share
2 answers

In accordance with the User Contributed Notes to rename()a Windows system problems when the target file already exists.

+5
source

One possibility is to simply hide the warning:

error_reporting(E_ALL & ~E_WARNING);
rename($old_name, $new_name);
error_reporting(E_ALL & ~E_NOTICE);
0
source

Source: https://habr.com/ru/post/1736838/


All Articles