Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@greatislander
Created January 12, 2017 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greatislander/ae54e374d32a8fa2f5a59713548eb46c to your computer and use it in GitHub Desktop.
Save greatislander/ae54e374d32a8fa2f5a59713548eb46c to your computer and use it in GitHub Desktop.
Check a file's mime type.
<?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