File input 'accept' attribute - is it useful?

前端 未结 8 1750
独厮守ぢ
独厮守ぢ 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 02:58

    It is supported by Chrome. It's not supposed to be used for validation, but for type hinting the OS. If you have an accept="image/jpeg" attribute in a file upload the OS can only show files of the suggested type.

提交回复
热议问题