When uploading a Energy Point 2000 document (.ppt) produced in Microsoft Energy Point it's a coming back a mime kind of application/vnd.ms-office. I'd expect application/vnd.ms-ms powerpoint to return from:
<?php $finfo = new finfo(FILEINFO_MIME); $mime_type = $finfo->file($filepath); // strip off the mime encoding information $mime_type = substr($mime_type, 0, strpos($mime_type, ';'));
Any ideas why this maybe the situation?
I'm running the next:
- PHP 5.2
- Apache 2
finfo ins't 100% reliable, particularly when it involves Microsoft 'office' documents. I do not think there's a simple fix for your solution. You could try, whether it returns
application/vnd.ms-office, then furthermore see if the extension from the file is
.ppt, and when it's, set the mime type to
application/vnd.ms-powerpoint. Obviously extra time is meaningless, but individuals using Microsoft, there's a high probability personal files with extension
.ppt is really a ms powerpoint and never other things.
Make certain the Apache MIME types file has got the correct MIME type for your file extention. You will want to take a look at
/conf/mime.types and add wrinkles when they don't exist.
application/vnd.powerpoint ppt application/vnd.powerpoint pptx
You will have to restart Apache after making these changes.