I need to differentiate between text file and image file without taking a look their path extension.
I would like to check if the file is actually the image or not. After searching, there is the way to check the mimetype from path extension, however, I would like the solution to verify the file's content itself.