文件上传验证-^(([[a-zA-Z] :) |(\\ {2} \ w +)\ $?)(\\(\ w [\ w].*))(.jpg | .JPG | .gif | .GIF)$ [英] File Upload validation - ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)$
本文介绍了文件上传验证-^(([[a-zA-Z] :) |(\\ {2} \ w +)\ $?)(\\(\ w [\ w].*))(.jpg | .JPG | .gif | .GIF)$的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对此表达式使用了正则表达式控制
"^(([[a-zA-Z] :) |(\\ {2} \ w +)\ $?)(\\(\ w [\ w].*))(.jpg | .JPG | .gif | .GIF)$"来验证fileuploader来检查文件是否为图像文件,或者它不起作用
如果您还有其他代码来验证用户上传的特定文件,则请尽快向我发送回复.
感谢回复
-Hiren Bhalsod
i used regular expression contol with this Expression
"^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)$" to validate fileuploader for check the file is image file or but it''s not work
if u have another code to valid a particular file uploded by user then plz send me ans as soon as possible.
Thanx for reply
- Hiren Bhalsod
推荐答案
?)(\\(\ w [\ w].*))(.jpg | .JPG | .gif | .GIF)
?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)
来验证fileuploader来检查文件是否为图像文件,或者它不起作用
如果您还有其他代码来验证用户上传的特定文件,则请尽快向我发送回复.
感谢回复
-Hiren Bhalsod
" to validate fileuploader for check the file is image file or but it''s not work
if u have another code to valid a particular file uploded by user then plz send me ans as soon as possible.
Thanx for reply
- Hiren Bhalsod
也许您需要学习正则表达式,而不是从网上随机获取内容?当然,这将测试文件是否具有特定扩展名,而不是文件是否恰好是图像文件.那是您只能在后面的代码中进行测试的内容.
Perhaps you need to learn regex instead of grabbing stuff at random off the web ? Of course, this will test if a file has a particular extension and not if it happens to be an image file or not. That is something you can only test in your code behind.
这篇关于文件上传验证-^(([[a-zA-Z] :) |(\\ {2} \ w +)\ $?)(\\(\ w [\ w].*))(.jpg | .JPG | .gif | .GIF)$的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文