i am doing a file upload page, but i dont want any code like PHP files or JavaScript.
But i dont know hardly any MIME types, is PHP a text/plain or does it have it's own mime type?
here is my code that blocks some mime types:
$userfile_type = $HTTP_FILE_VARS['file']['type']
#or something like that, i can't remember it excatly, but it works,
#ive tested it.
if ($userfile_type="text/plain")
#it wont be text/plain when i do it properly
{
echo ("File is plain text. This file is not allowed please choose another file");
exit;
}
what i wnated to know is
- Can you block certain extensions ike .php or .jsp?
- If not, what are the MIME types for JavaScript, PHP and other codes which could be a security risk?
Thanks 🙂