【问题标题】:plupload: validate image dimensions before upload?plupload:上传前验证图像尺寸?
【发布时间】:2021-06-09 10:30:48
【问题描述】:

我检查了文档但找不到任何东西.. 有没有办法在上传之前验证文件的图像尺寸?我想为最小图像尺寸添加规则,并在图像太小时显示错误消息。

【问题讨论】:

    标签: jquery validation plupload


    【解决方案1】:

    好的,我可以自己找到它:

    把这个放在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());
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-11
      • 2018-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-22
      • 1970-01-01
      • 2016-08-28
      相关资源
      最近更新 更多