PHP file upload always returns MIME type "inode/x-empty" -


so have function uploads terms & conditions folder. fetch extension , mime type of file , check if valid. of recently, files upload return $_files[$key]['size'] 0 while files on local disk have file size. when check mime type using following script, returns inode/x-empty.

$finfo    = finfo_open(fileinfo_mime_type); $filetype = finfo_file($finfo, $file['tmp_name']); // returns 'inode/x-empty' $expl     = explode('.', $file['name']); $fileext  = end($expl); 

i can't seem figure out why happening didn't couple of months back. i've never seen happen before either.

below example of $_files output:

array (     [name] => audite_marlow_logo.jpg     [type] => image/jpeg     [tmp_name] => /tmp/phpchbiln     [error] => 0     [size] => 0 ) 

the server's php.ini more capable of handling files upload. post_max_size set insane 128m.

all files upload return error integer value of 0.

i lost why happening.

because, ask finfo (phpchbiln) of tmp file name $_file['type'] check finfo of uploaded file (audite_marlow_logo.jpg). in other way, finfo need absolut path make sur tmp/phpchbiln absolut path.

inode/x-empty signify file trying check empty make sur file readeable simple check is_readable(), file_exists() or is_file().


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -