Created
January 12, 2017 14:59
-
-
Save greatislander/ae54e374d32a8fa2f5a59713548eb46c to your computer and use it in GitHub Desktop.
Check a file's mime type.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
parse_str(implode('&', array_slice($argv, 1)), $_GET); | |
$finfo = finfo_open(FILEINFO_MIME_TYPE); | |
$real_mime = finfo_file($finfo, $_GET['file']); | |
finfo_close($finfo); | |
echo $real_mime . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment