{"action":"created","issue":{"url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/408","repository_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet","labels_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/408/labels{/name}","comments_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/408/comments","events_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/408/events","html_url":"https://github.com/PHPOffice/PhpSpreadsheet/issues/408","id":302993814,"number":408,"title":"IOFactory::createReaderForFile throws an exception for xls file","user":{"login":"banstola","id":6429382,"avatar_url":"https://avatars3.githubusercontent.com/u/6429382?v=4","gravatar_id":"","url":"https://api.github.com/users/banstola","html_url":"https://github.com/banstola","followers_url":"https://api.github.com/users/banstola/followers","following_url":"https://api.github.com/users/banstola/following{/other_user}","gists_url":"https://api.github.com/users/banstola/gists{/gist_id}","starred_url":"https://api.github.com/users/banstola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/banstola/subscriptions","organizations_url":"https://api.github.com/users/banstola/orgs","repos_url":"https://api.github.com/users/banstola/repos","events_url":"https://api.github.com/users/banstola/events{/privacy}","received_events_url":"https://api.github.com/users/banstola/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-07T07:39:30Z","updated_at":"2018-04-03T07:03:36Z","closed_at":null,"author_association":"NONE","body":"This is:\r\n\r\n```\r\n- [X] a bug report\r\n\r\n```\r\n\r\n### What is the expected behavior?\r\n```\r\n    $filePath   = __DIR__ . \"/data.xls\";\r\n    $reader = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createReaderForFile($filePath);\r\n    $spreadSheet = $reader->load($filePath);\r\n\r\n    $dataAsAssocArray = $spreadSheet->getActiveSheet()->toArray();\r\n\r\n``` \r\n\r\nShould read the the active sheet into an array \r\n\r\n### What is the current behavior?\r\n\r\nThrows and excpetion with message : `Unable to identify a reader for this file in -[REMOVED]/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php on line 153`\r\n\r\n### What are the steps to reproduce?\r\n\r\nSee what is expected behaviour . Use a xls file . \r\n\r\n\r\n```php \r\n<?php\r\n\r\nrequire_once __DIR__ . \"/vendor/autoload.php\";\r\n\r\n$filePath   = __DIR__ . \"/data.xls\";\r\n\r\ntry {\r\n    $reader = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createReaderForFile($filePath);\r\n    $spreadSheet = $reader->load($file);\r\n\r\n    $dataAsAssocArray = $spreadSheet->getActiveSheet()->toArray();\r\n\r\n}\r\ncatch (\\Exception $exception){\r\n\r\n\r\n    //exception occurs\r\n    \r\n\r\n}\r\n\r\n// Trying the same thing with the predecessor library PHPExcel produces no error at all. \r\n$oldReader = PHPExcel_IOFactory::createReaderForFile($filePath);\r\n$oldSpreadSheet = $oldReader->load($filePath);\r\n\r\n$dataAsAssocArray = $oldSpreadSheet->getActiveSheet()->toArray();\r\n\r\n```\r\n\r\n\r\n### Which versions of PhpSpreadsheet and PHP are affected?\r\nPackages used.\r\n```json\r\n{\r\n    \"require\": {\r\n        \"phpoffice/phpspreadsheet\": \"^1.2\",\r\n        \"phpoffice/phpexcel\": \"^1.8\"\r\n    }\r\n}\r\n\r\n```\r\n\r\nThe `canRead` method of Xls class returns `false` in the new library while same method returns `true` in the old library that uses Excel5 class for the `xls` files.\r\n\r\n\r\npossibly related to issue #402 "},"comment":{"url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/comments/378149222","html_url":"https://github.com/PHPOffice/PhpSpreadsheet/issues/408#issuecomment-378149222","issue_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/408","id":378149222,"user":{"login":"banstola","id":6429382,"avatar_url":"https://avatars3.githubusercontent.com/u/6429382?v=4","gravatar_id":"","url":"https://api.github.com/users/banstola","html_url":"https://github.com/banstola","followers_url":"https://api.github.com/users/banstola/followers","following_url":"https://api.github.com/users/banstola/following{/other_user}","gists_url":"https://api.github.com/users/banstola/gists{/gist_id}","starred_url":"https://api.github.com/users/banstola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/banstola/subscriptions","organizations_url":"https://api.github.com/users/banstola/orgs","repos_url":"https://api.github.com/users/banstola/repos","events_url":"https://api.github.com/users/banstola/events{/privacy}","received_events_url":"https://api.github.com/users/banstola/received_events","type":"User","site_admin":false},"created_at":"2018-04-03T07:03:36Z","updated_at":"2018-04-03T07:03:36Z","author_association":"NONE","body":"Maybe you can check your php logs and post here as well as the code that you are using ... "}}
{"actor":{"display_login":"banstola"}}