Home > Backend Development > PHP Tutorial > PHP file upload .tmp file, finfo cannot read mime type

PHP file upload .tmp file, finfo cannot read mime type

WBOY
Release: 2016-09-27 14:18:07
Original
1366 people have browsed it

As shown in the picture

PHP file upload .tmp file, finfo cannot read mime type

PHP file upload .tmp file, finfo cannot read mime type

I am also messy,
PS:

in the picture above
<code>finfo_file($finof,basename($this->filePath))</code>
Copy after login
Copy after login

This is what I tested before

<code>finfo_file($finof,$this->filePath)</code>
Copy after login
Copy after login

Just try to print it, the problem is not that

Reply content:

As shown in the picture

PHP file upload .tmp file, finfo cannot read mime type

PHP file upload .tmp file, finfo cannot read mime type

I am also messy,
PS:

in the picture above
<code>finfo_file($finof,basename($this->filePath))</code>
Copy after login
Copy after login

This is what I tested before

<code>finfo_file($finof,$this->filePath)</code>
Copy after login
Copy after login

Just try to print it, the problem is not that

finfo_fileYou need to pass in the path of the file, not the file name.

basename('C:WindowsTempphpA9C5.tmp') === 'phpA9C5.tmp'.

So, you should remove the basenamefunction

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template