How to restrict file type in FileUpload control

后端 未结 8 2049
清歌不尽
清歌不尽 2020-11-30 09:29

Is it possible to allow the fileupload control to show only images?

When we click the Browse button it should show only images.

相关标签:
8条回答
  • 2020-11-30 10:25

    Assuming you mean uploading images only.

    You can check the ContentType property of the file (I.e. image/gif).

    Take a look here for an example: https://web.archive.org/web/20100306030822/http://www.15seconds.com/issue/061116.htm

    0 讨论(0)
  • 2020-11-30 10:29

    With plain <input type="file">, I am afraid it's not possible on the client-side.

    However, some 3rd party uploader such as SWFUpload provides this functionality.

    0 讨论(0)
提交回复
热议问题