如何屏蔽要上传的文件类型 [英] How to mask a file type for uploading
本文介绍了如何屏蔽要上传的文件类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我正在使用FileUpload控件上传文件.我的要求是,当我单击浏览"按钮时,我应该只能看到.pdf文件.如何屏蔽要显示的文件类型.
预先感谢.
Hello,
I am using FileUpload control to upload files. My requirement is when I click the Browse button, I should be able to see files of .pdf only. How can I mask for the File Type to be shown.
Thanks in advance.
推荐答案
否.无法将直接过滤器设置为FileUpload
控件,但是您可以添加仅接受给定文件格式的文件过滤逻辑.该逻辑可以在客户端或服务器端实现.
查看此 [
No. There is no way to set a direct filter toFileUpload
control but you can add a file filtering logic that accepts only given file formats. This logic can be implemented on client or server side.
Check out this[^] article for implementation details.
:)
这篇关于如何屏蔽要上传的文件类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文