File input 'accept' attribute - is it useful?

前端 未结 8 1629
独厮守ぢ
独厮守ぢ 2020-11-22 02:30

Implementing a file upload under html is fairly simple, but I just noticed that there is an \'accept\' attribute that can be added to the

8条回答
  •  花落未央
    2020-11-22 03:02

    Accept attribute was introduced in the RFC 1867, intending to enable file-type filtering based on MIME type for the file-select control. But as of 2008, most, if not all, browsers make no use of this attribute. Using client-side scripting, you can make a sort of extension based validation, for submit data of correct type (extension).

    Other solutions for advanced file uploading require Flash movies like SWFUpload or Java Applets like JUpload.

提交回复
热议问题