以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]让UpLoader只能上传一张图片并将图片压缩  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=118485)

--  作者:mxko
--  发布时间:2018/5/4 8:07:00
--  [求助]让UpLoader只能上传一张图片并将图片压缩

如题 :想让UpLoader只能上传1张图片,并将图片压缩

代码如下:

With wb.AddInputGroup("form1","ipg1","文件上传")
    With .AddUploader("drivinglicence","行驶证")

        .AllowDelete = True
        .Incremental = True
        .ScaleHeight = 400
    End With
End  With

还是能上传多张图片,把  .Incremental = True 去掉后 又没法压缩图片

请大大们帮忙,感谢!

 


--  作者:有点甜
--  发布时间:2018/5/4 8:47:00
--  

提交的时候,检测一下即可,js代码

 

var v1 = document.getElementById("up1_thumbnails").getElementsByTagName("li").length;

if(v1 < 1){

  showTopTips("toptip1","请选择1张展示照上传!",2000);
  return false;
}
if(v1 > 1){
  showTopTips("toptip1","展示照只可以上传1张!",2000);
  return false;
}

--  作者:mxko
--  发布时间:2018/5/4 8:57:00
--  
非常感谢