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

后端 未结 3 1009
星月不相逢
星月不相逢 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:18

    $_FILES['profile']['name'] has just name of the file.. you need to access

    $_FILES['profile']['tmp_name'] 
    

    will give you the temporary path of the file on your system. Here is http://php.net/manual/en/reserved.variables.files.php

    also you can access size of file with

    $_FILE['profile']['size']
    

提交回复
热议问题