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
Post a Comment