MIME type XLSX (from LibreOffice)
excel, file-upload, libreoffice, mime-types, php
Solution
try this
if((mime_content_type($file) == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || mime_content_type($file) == 'application/vnd.ms-excel' || mime_content_type($file) == 'application/vnd.openxmlformatsofficedocument.spreadsheetml.sheet') && ($extension == 'xls' || $extension == 'XLS' || $extension == 'xlsx' || $extension == 'XLSX')){...upload...}
Problem
I'm trying to solve one problem: I want to upload to my website XLS/XLSX file. And I've there for it this condition: ``` if((mime_content_type($file) == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || mime_content_type($file) == 'application/vnd.ms-excel') && ($extension == 'xls' || $extension == 'XLS' || $extension == 'xlsx' || $extension == 'XLSX')){...upload...} ``` When I use the XLS/X file (which has been saved directly from MS Excel), it works great. But when I want to upload XLS/X file - which has been saved directly from LibreOffice (not as ODS, but as an XLS/X) - it doesn't work and I can't upload this file. Thanks for any help! (And the condition with application/vnd.oasis.opendocument.spreadsheet doesn't work as well.) Update: Thanks to Dipanwita Kundu I was able to find, which MIME type is used (`application/octet-stream`) - but its safe to put this as the condition?