在asp.net中的文件上传控件中验证以kb为单位的图片大小 [英] validate image size in kb in file upload control in asp.net

查看:99
本文介绍了在asp.net中的文件上传控件中验证以kb为单位的图片大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何验证在asp.net文件上传控件中上传的图像必须小于700 kb.如果没有web.config方法.或者如果来自web .config方法,请提供错误处理程序.thanx

how can i validate that image being uploaded in asp.net file upload control must be less than 700 kb . without web.config method .or if from web .config method ,please give error handler.thanx

推荐答案

图像大小.

在上传到服务器之前

你不能.

上传到服务器后

Image size.

before uploading to the server

you can''t.

After upload to the server

FileInfo fno = new FileInfo("c:\\test.txt");
                        //length in bytes
                        long bytes = fno.Length; 



谢谢
--RA



Thanks
--RA


这篇关于在asp.net中的文件上传控件中验证以kb为单位的图片大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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