Read an uploaded spreadsheet document by php-SpreadsheetReader
In PHP, the global array $_FILES will contain all the uploaded file information. However, the temporary filename of the file in which the uploaded file was stored on the server is not the same as source filename. If you pass the temporary filename to SpreadsheetReaderFactory, it could not detect which reader to suit.
The solution is simple. We simply take the extension name from $_FILES['userfile']['name'] and pass it to SpreadsheetReaderFactory. Then we pass $_FILES['userfile']['tmp_name'] to reader. That's all.
The following is a sample. There is a file field named 'SpreadsheetFile' in the form. PHP will put information of this uploaded file in $_FILES['SpreadsheetFile'].