真的没有办法限制浏览文件窗口中显示的文件类型吗?我尝试了这个:
<input type="file" accept="text/xml" name="parameter_file" />
Firefox,IE只是忽略它.我从另一个问题中找到了以下摘录:
Accept attribute was introduced in the@H_403_15@ RFC 1867,intending to enable@H_403_15@ file-type filtering based on MIME type@H_403_15@ for the file-select control. But most,@H_403_15@ if not all,browsers make no use of@H_403_15@ the this attribute.
我还能怎么做?我知道您可以使用Flash来实现这一目标,但我真的不想使用Flash.
我将在服务器端检查选定的文件类型,但我想通过简化显示XML文件的方式来改善用户体验.
谢谢大家的帮助.
最佳答案