日期:2014-05-17  浏览次数:20448 次

uploadify的onUploadSuccess 不执行
本帖最后由 yksyuan 于 2012-11-27 08:53:16 编辑



  $("#uploadify").uploadify({
       'uploader': 'scripts/uploadify.swf', //上传所需的flash文件
        'script': 'scripts/upload.ashx?roomid=' + id, //后台处理文件
        'cancelImg': 'scripts/cancel.png', //取消按钮的图片
        'buttonImg': 'scripts/select.gif', //按钮图片
        'folder': '/uploads', //上传文件夹
        'queueID': 'fileQueue',
       'queueSizeLimit': 1, //限制每次选择文件的个数
        'auto': true, //是否自动上传
        'multi': false, //是否多选
        'sizeLimit': 6291456, //上传文件限制的最大值
        'simUploadLimit': 1, //同时上传的文件个数
        'fileDesc': '图片文件', //文件类型的描述信息
        'fileExt': '*.jpg;*.png;*.bmp;*.gif', //设置文件类型
        'onQueueFull': function(event, queueSizeLimit) { alert("只允许上传" + queueSizeLimit + "个文件"); event.data.action(event, queueSizeLimit) = false; },
       'width': 77, //按钮宽度
        'height': 23, //按钮高度
        'wmode': 'transparent', //设置按钮背景透明
                
                
         'onSelect': function(file) { alert("选择文件时触发事件"); }, //选择文件时触发事件
         'onSelectError': function(file, errorCode, errorMsg) { alert("选择文件有误触发事件"); }, //选择文件有误触发事件
         'onUploadComplete': function(file) { alert("上传成功触发事件"); }, //上传成功触发事件
         'onUploadError': function(file, errorCode, errorMsg) { alert("上传失败触发事件"); }, //上传失败触发事件
         'onUploadProgress': function(file, fileBytesLoaded, fileTotalBytes) { alert("上传中触发事件"); }, //上传中触发事件
          'onUploadStart': function(file) { alert("上传开始触发事件"); }, //上传开始触发事件
         'onUploadSuccess': function(event, response, status) { alert("当单个文件上传成功后激发的事件"); } //当单个文件上传成功后激发的事件

   });


除了'onSelect'触发了,后面几个时间都没有触发,
不知道为什么?

------解决方案--------------------
不执行onUploadSuccess,你的文件上传成功了吗?
------解决方案--------------------
哦,是jquery.uploadify-3.1.js啊。这个真不执行,哈哈。
包里带的是jquery什么版本了
------解决方案--------------------
别的事件都执行了吗?
------解决方案--------------------