Warning: filesize(): stat failed for img.jpg

后端 未结 3 997
星月不相逢
星月不相逢 2021-01-12 13:39

I am trying to get the file size of an image and I keep getting Warning: filesize(): stat failed for img.jpg

This is what I did:

         


        
3条回答
  •  情歌与酒
    2021-01-12 14:32

    ['name'] in the $_FILES array is the name of the file on the CLIENT machine. It is information only, and has absolutely no relevance to what's actually stored on your server. You need to look at ['tmp_name'], which is where PHP has stored the file temporarily on the server, after the upload completed:

    $path = $_FILES['profile']['tmp_name'];
                              ^^^^^^^^^^^^
    

提交回复
热议问题