通过文件上传控件asp.net验证图像宽度 [英] validate image width while upload by file upload control asp.net

查看:46
本文介绍了通过文件上传控件asp.net验证图像宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过文件上传控件asp.net进行上传时验证图像宽度

帮帮我..............

在此先感谢

validate image width while upload by file upload control asp.net

help me ..............

thanks in advance

推荐答案

我自己还没有这样做,所以希望有人能提供更完整的答案.

有一个名为uploadify的jquery插件,如果您想在客户端进行检查,可能会有所帮助. [图像 [限制 [
I haven''t done this myself so hopefully someone will chip in with a more complete answer.

There is a jquery plugin called uploadify that might help if you want to check on the client side. This[^] is a discussion on Stack Overflow with a problem similar to yours, only they wanted a minimum width. The Javascript is what is useful here, rather than the PHP.

Even if you are validating client side you should validate on the server. In code you can use the Image[^] object to get the width of an image. You can create the Image object via the FromStream method (assuming you can get the stream - I don''t know if uploadify will allow this) or by getting the file path of the uploaded file and using the FromFile method. Note that there are restrictions[^] on the types of files Image will support


这篇关于通过文件上传控件asp.net验证图像宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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