要素で、<input type="file" >
拡張子 .srt のファイルを選択し、javascript を使用してファイルの種類を判別しています。
var file=document.getElementById('fselect').files[0];
success = file.type =='application/x-subrip'? true : false;
console.log('selected a file of type='+file.type);
console.log('selected a subtitle file='+success);
ただし、期待どおりの結果が得られるのはchrome 18.0.1025.168
selected a file of type= application/x-subrip
selected a subtitle file= true
しかし、firefox 12
firebugがインストールされていると、私は得る
selected a file of type=
selected a subtitle file= false
私はこれに混乱しています..どうすれば両方のブラウザでファイルの種類を一貫して判断できますか?