Last active
December 16, 2015 21:59
-
-
Save AmyStephen/5503673 to your computer and use it in GitHub Desktop.
Mimetypes list maintained by http://www.webmaster-toolkit.com/mime-types.shtml
This file contains hidden or 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 | |
/** | |
* Mimetype for your file - requires PHP 5.3, not enabled on default by Windows | |
*/ | |
$php_mime = finfo_open(FILEINFO_MIME); | |
$this->mime_type = strtolower(finfo_file($php_mime, $this->your_file_path_and_name)); | |
finfo_close($php_mime); | |
// Thanks for great discussion from Ben Ramsey, Anthony Ferrara, Dave Reid, Jarvis Badgley | |
// always escape user input when echoing output | |
// *never* execute a file that has been uploaded | |
// Mime list - http://www.webmaster-toolkit.com/mime-types.shtml | |
// Apache list - http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | |
// From Jarvis Badgley - https://t.co/IMm1wgJT09 | |
// It is *not* safe http://www.youtube.com/watch?v=dG5Qk-jB0D4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Serious work in this area by Beau Simensen Twitter
Snort looks promising.