php - How to get image file format if it doesn't have an extension? -


i have folder of image files. of them don't have extension. need find format , attach proper extension them through php or shell programming in linux/ubuntu. can please me how it?

i dont have enough reputation post comment, so... see if anything

$finfo = finfo_open(fileinfo_mime_type); $mime = finfo_file($finfo, $_files['afile']['tmp_name']); 

this should store detected file format $mime.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -