elis Posted March 31, 2009 Share Posted March 31, 2009 This is a snippet from an upload script I'm using (let me know if I haven't provided enough of the script, please.) <?php $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, $fileSize); fclose($fp); if($fileType != ("application/msword")) { $wordOnly = "<font color=\"red\"><b>Error message</b></font><p/>"; } else .... ?> Which is for an upload script for users to upload MS Word documents which are then stored. The problem is, it correctly uploads for .doc files (MS Word 97-03) but doesn't work for .docx (MS Word 07+). I'm not familiar with PHP, Mime types, and so forth so forgive any ignorance. Does anyone have any suggestions to fix this? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 31, 2009 Share Posted March 31, 2009 When I upload a .docx file this is the mime type: application/vnd.openxmlformats-officedocument.wordprocessingml.document Ken Quote Link to comment Share on other sites More sharing options...
elis Posted March 31, 2009 Author Share Posted March 31, 2009 Thank you! Worked perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.