How to make input type= file Should accept only pdf and xls

后端 未结 9 2147
一生所求
一生所求 2020-12-13 11:26

I used

Now I would like to restrict this by accepting only .pdf and .xls files.

When I click the s

9条回答
  •  鱼传尺愫
    2020-12-13 12:06

    You can try following way

    
    

    OR (in asp.net mvc)

    @Html.TextBoxFor(x => x.FileName, new { @id = "doc", @type = "file", @accept = "application/pdf,.csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" })
    

提交回复
热议问题