uploadify 文件上传参数解析

来源:互联网 发布:c 里基本蚁群算法 编辑:程序博客网 时间:2024/05/22 15:24
$('#sendImgId').uploadify({swf:URL.fullPath + 'js/uploadify/uploadify.swf',uploader:URL.operation + "?action=sendImg",width:'25', height:'25', cancelImg:"", buttonImage:"", buttonClass:"", buttonText: '',auto:true,                              // 是否自动开始 multi:false,                            // 是否支持多文件上传                        simUploadLimit: 1,                      // 一次同步上传的文件数目 sizeLimit: 1024 * 1024 * 30,            // 设置单个文件大小限制 queueSizeLimit: 1,                      // 队列中同时存在的文件个数限制fileTypeDesc:'支持格式:jpg/gif/jpeg/png/bmp',fileTypeExts: '*.jpg;*.gif;*.jpeg;*.png;*.bmp',// post 附加在文件的后面formData : {},onInit : function(swf){var obj = swf.wrapper.find("object");               obj.attr({"onmouseover":"this.className='OO_btnlist2_over'", "onmouseout":"this.className='OO_btnlist2_out'", title:'图片'}).addClass("OO_btnlist2_out").css({"position":"absolute", "margin-top":1});$("#sendImgId-queue").hide();},onUploadComplete: function () { /* 防止库调用自己的*/ },onUploadError: function() { log("文件上传失败"); }, onUploadSuccess: function(file, data, response){ var x = this;setTimeout(function(){var name = file.name;name = ' ' + x.img + name.substr(name.lastIndexOf("."), name.length) + ' ';insertMsgBlock({type:"wbim_msgr", nick:null, date:x.date.replace(_dateRegExp, ""), msg:name});scrollToEnd();           // 保存记录savePanelRecord(_curTalkObj.getJid(), {self:_curTalkObj.getUser(), date:x.date, msg:name});AjaxUtil.sendOpAct('act_tf_send_msg', JSON.stringify({jid:_curTalkObj.getJid(), date:x.date, val:name}));}, '100');},onUploadStart : function(file) {// 创建 图片名称var x = Math.random() + "";this.img = "img_" + x.replace(/0\./, "");this.date = getFormatDate();// 设置接收对象$('#sendImgId').uploadify("settings",                               // 方法名称"formData",                                                 // name{"to":_curTalkObj.getJid(), "date":this.date, "img":this.img, "r":MyInfo.getRdom()}); // value}});


中文文档:http://www.yauld.cn/uploadifydoc/

多文件上传例子:http://lisanlai.iteye.com/blog/680785


0 0
原创粉丝点击