When loading PHP, I try to check the MIME type of the downloaded files so that they match the valid set of MIME types for the application. When you try to use fileinfo () to determine the MIME type for an Office 2007 file, it is NOT detected as the corresponding MIME types. Instead, the MIME type response is "application / zip"
Office MIME document types: http://filext.com/faq/office_mime_types.php
PHP code example:
$ oFileInfo = new finfo (FILEINFO_MIME_TYPE);
$ sMimeType = $ oFileInfo → file ($ _FILES ['Filedata'] ['tmp_name']);
echo $ sMimeType;
Server setup information:
- OS: 32-bit version of Windows Server 2003
- Web Server: IIS 6.0
- PHP: 5.3.5 (Thread Safe) using FastCGI 1.5
- File: magic.mime
- Example from darko on uvcms dot com 16-Apr-2008 09:35
- Link: php.net/manual/en/fileinfo.installation.php
- Size: 517 KB
- Source: Source Forge: GNU32 - FileType gnuwin32.sourceforge.net/packages/filetype.htm
I found a lot of messages that refer to problems with the new Office format when downloading from a web server. In all these examples, I have not found anywhere, which illustrates the estate of adding new MIME types to an existing magic.mime file or a link to a magic.mime file that already contains Microsoft Office 2007+ MIME types. Thank you for your help.
source share