I created a function to check the file extension of and imported Excel file. I have run same source on 2 different PCs.
PC-1 Configuration:
- Win 7 64bit
- XAMPP with PHP 7.0.x
- Browser Google Chrome
- Microsoft Office 2013 installed
PC-2 Configuration:
- Win 10 64bit
- XAMPP with PHP 7.1.x
- Browser Google Chrome
- Open Office installed. Not install MS Office
My Excel file was created by Google Spreadsheet and exported as an MS Office file with extension .xlsx.
In PC-1, when I debug the $_FILES['file']['type'];
value I get the extension:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
Yet on PC-2, I received:
'application/octet-stream'
My question is: Why with same source, same import file, just different environments, does the debug output show a different file extension? Is the cause installing MS Office?