验证控件可用于上传文件uploding控件中的文件。因此,不能上载超过1MB的文件 [英] Validation control can be used to upload a file in file uploding control.so that no file more than 1MB can be uploaded

查看:127
本文介绍了验证控件可用于上传文件uploding控件中的文件。因此,不能上载超过1MB的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

验证控件可用于上传文件uploding control中的文件。因此,不能上传超过1MB的文件

Validation control can be used to upload a file in file uploding control.so that no file more than 1MB can be uploaded

推荐答案

试试这个:

上传前jQuery检查文件大小 [ ^ ]


请使用此代码

Please use this code
int fileSize = FileUpload1.PostedFile.ContentLength;





如果你想限制最大尺寸为1 mb然后检查



if you want to limit max size as 1 mb then check

if (fileSize <  1024)





希望这可能帮助你。



Hope this may help you.


这篇关于验证控件可用于上传文件uploding控件中的文件。因此,不能上载超过1MB的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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