reply$lastimg actually equals jpg, so there is definitely no problem with the . in the middle. There is a problem just because the previous date is added.
replyWarning: move_uploaded_file(upload/images/2017-08-23 15:09:066.jpg): failed to open stream: Invalid argument in D:phpStudyWWWfile.php on line 40
Warning: move_uploaded_file(): Unable to move 'C:UsersAdministratorAppDataLocalTempphp2872.tmp' to 'upload/images/2017-08-23 15:09:066.jpg' in D:phpStudyWWWfile.php on line 40
上传失败
这是报错信息
replyDo important things need to be said three times? --! Then take a look at your entire code post. If this is correct, then it must be the mistake behind it.
replyI modified it as you said, but it still doesn't work. These are a few lines of code. Lastimg is the original one. There is no problem with this.
$name=date('Y-m-d H:i:s').rand(0,10).'.'.$lastimg;
if (is_uploaded_file($_FILES['file']['tmp_name'])) {
if (move_uploaded_file($_FILES['file']['tmp_name'], $path .$name)) {
Post the error message. rand(0,10).'.'.$lastimg; The code here is wrong. Change it to rand(0,10).$lastimg;
Reply
What you are reporting is an error in the parameters of the date function
date('Y-m-d H:i:s), pay attention to capitalization