图像大小验证:jQuery [英] image size validation : jQuery

查看:81
本文介绍了图像大小验证:jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



使用JQuery上载时验证图像大小.

例如:当我设置图像大小,宽度:100px和高度:130px时,则仅允许上传,否则将提示消息.

问候
Rajesh

Hi,

Validate the Image Size when i upload, using JQuery.

For Example: when i set the Image size, width : 100px and Height : 130px then only allow to upload otherwise said to alert Message.

Regards
Rajesh

推荐答案

你好,

只能通过纯JavaScript和客户端无法找到文件的大小,无论是图像还是其他任何东西.现代浏览器不允许访问客户端PC上的物理文件,实际上,它们甚至不允许您的脚本知道真实路径.但是,您可以使用少量的Ajax和JQuery File Upload插件(例如 BlueImp [^ ]或 Uploadify [ ^ ].

问候
Hello,

There is no way to find out the size of a file be it a image or anything via pure javascript and client side only. Modern browser won''t allow access to the physical file residing on client''s PC, In fact they won''t even allow your script to know the real path. However you may be able to do this using little Ajax and JQuery File Upload plugin such as BlueImp[^] or Uploadify[^].

Regards,


这篇关于图像大小验证:jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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