Thinkphp5 obtain file upload information

Thinkphp5 built-in method of handling file uploads, because not found in the developer documentation for instructions to upload the file basic information, it is here to do some recording.

$ File = request () -> file ( 'input for the type of file name value', '');

$fileInfo = $file->getInfo();

Can () helper function to view information Print $ fileInfo with the halt, the following information:

<pre>

array(5) {
["name"] =&gt; string(20) "file_name.png"
["type"] =&gt; string(9) "image/png"
["tmp_name"] =&gt; string(53) "C:\Users\Administrator\AppData\Local\Temp\php9481.tmp"
["error"] =&gt; int(0)
["size"] =&gt; int(19220)
}
</pre>

Guess you like

Origin www.cnblogs.com/wheats/p/11227700.html