Multi-image upload in ueditor, file duplication problem

The problem is as follows. All three files show that the upload is successful, but the editor shows three duplicate files.
Insert picture description here
Insert picture description here
At this time, we check the request results of uploading files three times, and found that the file names generated after uploading the files are all the same. The file is overwritten.
Insert picture description here
The reason for this is that an error occurred when php generated the custom file name. We found the PHP file responsible for uploading the program and looked at the code that generated the custom file name. rand() generates a random number to ensure that the file name is not repeated. But here, the second parameter of the function exceeds the maximum value of the php int type, causing rand to return NUll. Therefore, the three custom file names are duplicated, and everything is normal after modification.

Insert picture description here

Guess you like

Origin blog.csdn.net/u012830303/article/details/99441608