Home > Article > Backend Development > PHP file upload .tmp file, finfo cannot read mime type
As shown in the picture
I am also messy,
PS:
<code>finfo_file($finof,basename($this->filePath))</code>
This is what I tested before
<code>finfo_file($finof,$this->filePath)</code>
Just try to print it, the problem is not that
As shown in the picture
I am also messy,
PS:
<code>finfo_file($finof,basename($this->filePath))</code>
This is what I tested before
<code>finfo_file($finof,$this->filePath)</code>
Just try to print it, the problem is not that
finfo_file
You need to pass in the path of the file, not the file name.
basename('C:WindowsTempphpA9C5.tmp') === 'phpA9C5.tmp'
.
So, you should remove the basename
function