How to get my checking MIME type script to work? (PHP)

Posted by ggfan on Stack Overflow See other posts from Stack Overflow or by ggfan
Published on 2010-04-05T16:34:43Z Indexed on 2010/04/05 16:43 UTC
Read the original article Hit count: 108

Filed under:

For this script, it checks to see if the file is a microsoft words doc or ppt. I am not sure why this isn't running because it works for image MIME and text/plain.

I am using PHP 5.3.1 so it should have all the MIME types installed already right?

I am uploading words and powerpoint 2007.

//Does the file have the right MIME type?
if ($_FILES['userfile']['type'] !='application/msword') {
    echo 'Problem: file is not words doc.';
    exit;
}

© Stack Overflow or respective owner

Related posts about php