uploadify 图片上传demo

来源:互联网 发布:大将军手写板软件 编辑:程序博客网 时间:2024/05/22 03:51
$("#uploadify").uploadify({         'auto': true, //          'swf': 'js/uploadify.swf',          'queueID': 'fileQueue',             'uploader': 'http://localhost:8081/upload/photo.do',          'queueSizeLimit': 1, //          'fileTypeDesc': 'jpg文件或png文件', //          'fileTypeExts': '*.jpg;*.png', //控制可上传文件的扩展名,启用本项时需同时声明fileDesc            'multi': true,          'buttonText': '上传',          'cancelImg': 'images/cancel.png',          'folder': 'uploads',          'lgq': 'filename',          'buttonClass': '',          'height': 30,          'width': 60,          'onUploadSuccess': function(file, data, response) {              var result= eval('(' + data + ')');               if(result.code===''){                  alert('');              }else{                  $("#filepath").val(result.path);                  $("#filename").val(result.filename);              }          },'onUploadError' : function(e, i, h) {              $("#filepath").val("");              $("#filename").val("");              alert("上传失败");          },'onUploadStart' : function(d) {               $("#filepath").val("");              $("#filename").val("");          },'onSelect': function(fileObj){              if(fileObj.size > 5120000){                  alert('当前选择的文件超过了5M,请重新选择文件!');                  this.cancelUpload(fileObj.id);                  return false;              }          }      });
原创粉丝点击