ASP.NET - 在FileUpload控件浏览器中仅显示图像文件 [英] ASP.NET - Show only image files in FileUpload control Browser

查看:73
本文介绍了ASP.NET - 在FileUpload控件浏览器中仅显示图像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想在按钮点击时显示fileupload控制浏览器,然后在文件上传浏览器中显示

它显示所有文件(文件类型是底部的所有文件),现在我只需要显示图像格式(jpg,gif,png)

当文件上传浏览器打开时,请发送编码给我。提前谢谢。

Hi guys,

I want to display the fileupload control browser when the button click, and after that in the file upload browser
it display all the files( file type is All files in the bottom), now i need only display the image format(jpg,gif,png)
when the file upload browser open, please send the coding to me. thanks in advance.

推荐答案

不需要这个。你不能限制。但有一种方法。请参阅 - 使用< input type =file>?时限制文件格式[ ^ ]。



理想情况下你应该验证文件类型 - ASP.Net FileUpload:文件扩展验证 [ ^ ]。
No need of this. You cannot restrict. But there is a way. Refer - Limit file format when using <input type="file">?[^].

You should ideally validate the file type - ASP.Net FileUpload : File Extension Validation[^].


这篇关于ASP.NET - 在FileUpload控件浏览器中仅显示图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆