问题描述
我检查了文档但找不到任何东西..有没有办法在上传之前验证文件的图像尺寸?我想为最小图像尺寸添加规则并在图像太小时显示错误消息。
解决方法
好的,我可以自己找到:
把它放在 FilesAdded
函数中:
plupload.each(files,function(file,i)
{
var img = new mOxie.Image;
img.onload = function () {
var wi = this.width;
var he = this.height;
// you can validate here
};
img.load(file.getSource());
});