Check the MIME Type of a file created by PHPExcel

Topics: Developer Forum, User Forum
Feb 28, 2008 at 4:10 PM
Edited Feb 28, 2008 at 4:12 PM

I would like to know what is the MIME type of a Excel document created by PHPExcel. Normally it should be: application/ for Excel2003 document or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for an Excel2007 document. But when i am checking the mime type with PHP to upload a file already created it is not working....

Below is my PHP code to check which mime type the file is (it is working fine normally):

} else {

Does someone has any clue about it?

Thanks a lot!
Feb 28, 2008 at 5:04 PM
Is there a mime type definition in your web server's configuration present for XLSX?
Feb 29, 2008 at 9:25 AM
Edited Feb 29, 2008 at 9:26 AM

maartenba wrote:
Is there a mime type definition in your web server's configuration present for XLSX?

Thanks for your quick reply maartenba! :)

I am using one of the last version of XAMPP ( as test server (because the web application is not running yet). I check a bit online, I could not find any information about it. So probably it does that... I do not know..
The thing is it recognizes well the Excel2003 files when I send one I just created, it does the action1 (which is what I want), but when I send a Excel file created with PHPExcel so with normally the MIME type of Excel2007, it does not work and it executes the action2.
Feb 29, 2008 at 10:16 AM

Actually I just try now and it is working fine! :-) I worked a bit on it, yesterday... Maybe I correct one mistake I did without noticing...

Thanks a lot, anyway! Take care!
Keep up with the good work!
Feb 29, 2008 at 10:44 AM
Glad it works now! Happy PHPExcel-ing :-)