This is because the character encoding of PHP is different from that of Windows. The Simplified Chinese version of Windows generally uses gbk or gb2312 encoding for naming file names. Most of the values of non-ASCII string variables in PHP use utf8 encoding (of course, this default value can be modified...). The $name variable needs to be converted to gbk encoding before it can be named and stored in the Windows file system. You can use the mb_convert_encoding function to convert the encoding of a string.
Assume that php is utf8 encoding, then change move_uploaded_file($tmp_name,'upload/' .$name); in the code to move_uploaded_file($tmp_name,'upload/'.mb_convert_encoding($name));
The above introduces the error reported by move_uploaded_file and rename functions of yii uploaded files, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.