{"action":"opened","issue":{"url":"https://api.github.com/repos/thephpleague/flysystem/issues/684","repository_url":"https://api.github.com/repos/thephpleague/flysystem","labels_url":"https://api.github.com/repos/thephpleague/flysystem/issues/684/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/flysystem/issues/684/comments","events_url":"https://api.github.com/repos/thephpleague/flysystem/issues/684/events","html_url":"https://github.com/thephpleague/flysystem/issues/684","id":170357267,"number":684,"title":"Local Adapter's getMimetype method is unreliable","user":{"login":"afroewis","id":5163630,"avatar_url":"https://avatars.githubusercontent.com/u/5163630?v=3","gravatar_id":"","url":"https://api.github.com/users/afroewis","html_url":"https://github.com/afroewis","followers_url":"https://api.github.com/users/afroewis/followers","following_url":"https://api.github.com/users/afroewis/following{/other_user}","gists_url":"https://api.github.com/users/afroewis/gists{/gist_id}","starred_url":"https://api.github.com/users/afroewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afroewis/subscriptions","organizations_url":"https://api.github.com/users/afroewis/orgs","repos_url":"https://api.github.com/users/afroewis/repos","events_url":"https://api.github.com/users/afroewis/events{/privacy}","received_events_url":"https://api.github.com/users/afroewis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-10T08:10:43Z","updated_at":"2016-08-10T08:10:43Z","closed_at":null,"body":"With some files (I created an empty xlsx file (`test.xlsx`) with LibreOffice for my test), Flysystem's `Local` Adapter does not return the correct mime type in it's `getMimeType` method. The method returns `application/octet-stream`, even though the mime type would be guessable by the file's extension (`xlsx`). \r\n\r\nThe `League\\Flysystem\\Util::getMimeType` method is much more reliable. It considers the file's extension and uses it as a fallback if the file's mime type can not be guessed with FInfo. \r\n\r\nI think it's a bit confusing that `Local::getMimeType` does not use `League\\Flysystem\\Util::getMimeType` and makes a FInfo call instead. The `Local` adapter should use the `Util` class, too. \r\n\r\nI would be happy to provide a PR that solves the problem."}}
{"actor":{"display_login":"afroewis"}}