How to handle mp3 files?
已回答
It happens often that I have to insert some audio files (most of the time mp3) in a project and I copy them from a folder of the Mac and paste them in the directory tree of Phpstorm. The last time I did this, Phpstorm tried to automatically show the file in an editor panel, showing an error that it was using a wrong encoding. Besides this, Phpstorm kind of crashed. And I couldn't even close the panel with the mp3 file. I had to force quit phpstorm, but when I opened it again it opened the same session with the same panels, so it stuck again. In the end I solved by deleting the file "workspace.xml" in the .idea folder of the project.
Is there any way to keep Phpstorm from opening these files?
请先登录再写评论。
Hi there,
Do you mean that PhpStorm tries to open .mp3 file in the editor tab just as it would do with php/css/html ?
If so -- please check you settings at "Settings/Preferences | Editor | File Types" -- see what file type that file (that extension rather) is associated with and maybe remove such association -- most likely you have associated it with Text files (a wild guess, but seems quite possible). As potential alternative -- re-assign it to the "Files Opened In Associated Applications" type.
I meant exactly that and the problem was that *.mp3 was treated as a text file under File Types, as you said. Probably I did it by mistake without even realizing.
The whole thing has been a bit frustrating because at first it wasn't obvious what the problem was. I couldn't really see the file name, so it took me a while to figure out what was going on. Also, in the File Types menu apparently there's no way to search by extension, so I had to go through all the list of file types.
But now I fixed it, thanks!