{"id":507,"date":"2016-05-11T14:07:15","date_gmt":"2016-05-11T06:07:15","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=507"},"modified":"2016-05-11T14:08:27","modified_gmt":"2016-05-11T06:08:27","slug":"uploadify%e6%8f%92%e4%bb%b6%e7%9a%84%e5%8f%82%e6%95%b0%e5%b1%9e%e6%80%a7%e3%80%81%e4%ba%8b%e4%bb%b6%e3%80%81%e6%96%b9%e6%b3%95%e5%87%bd%e6%95%b0%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=507","title":{"rendered":"Uploadify\u63d2\u4ef6\u7684\u53c2\u6570\u5c5e\u6027\u3001\u4e8b\u4ef6\u3001\u65b9\u6cd5\u51fd\u6570\u8be6\u89e3"},"content":{"rendered":"<p>\n\tWeb\u4e0a\u4f20\u6587\u4ef6\u662f\u4e00\u4e2a\u5f88\u5e38\u7528\u7684\u529f\u80fd\uff0c\u8bd5\u7528\u8fc7\u4e0d\u5c11\u4e0a\u4f20\u7ec4\u4ef6\uff0c\u8981\u4e48\u662f\u6bcf\u6b21\u53ea\u80fd\u9009\u62e9\u4e00\u4e2a\u6587\u4ef6\uff0c\u8981\u4e48\u662f\u9009\u62e9\u4e86\u6587\u4ef6\u540e\u4e0d\u80fd\u53d6\u6d88\uff0c\u76f4\u63a5\u4e0a\u4f20\uff0c\u8981\u4e48\u5c31\u662f\u5bf9\u6587\u4ef6\u3001\u961f\u5217\u7b49\u9650\u5236\u652f\u6301\u4e0d\u4f73\u3002\u9762\u5bf9\u8fd9\u4e48\u591a\u95ee\u9898\uff0cUploadify\u63d2\u4ef6\u5168\u90e8\u90fd\u80fd\u5b9e\u73b0\u3002<br \/>\n\tUploadify\u662f\u4e00\u4e2ajQuery\u63d2\u4ef6\uff0c\u4f60\u53ef\u4ee5\u5f88\u5bb9\u6613\u7684\u4e3a\u4f60\u7684\u7f51\u7ad9\u6dfb\u52a0\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd\u3002\u5b83\u6709\u4e24\u4e2a\u4e0d\u540c\u7684\u7248\u672c\uff08HTML5\u548cFlash\uff09\u5141\u8bb8\u4f60\u7075\u6d3b\u9009\u62e9\u4e3a\u60a8\u7684\u7f51\u7ad9\u5b9e\u73b0\u5404\u79cd\u573a\u666f\u4e0b\u7684\u529f\u80fd\u548c\u9700\u6c42\u3002\u5b83\u7684\u4f18\u70b9\u5982\u4e0b\uff1a<br \/>\n\t<strong>\u591a\u6587\u4ef6\u4e0a\u4f20<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;Uploadify\u7684\u4e3b\u8981\u597d\u5904\u662f\u5b83\u5141\u8bb8\u591a\u4e2a\u6587\u4ef6\u4e0a\u4f20\uff0c\u652f\u6301ctrl\u591a\u9009<br \/>\n\t<strong>\u652f\u6301\u62d6\u653e\u6587\u4ef6<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;\u6587\u4ef6\u4e0a\u4f20\u7684HTML5\u7248\u672c\uff08uploadifive\uff09\u5141\u8bb8\u62d6\u653e\u6587\u4ef6\u5230\u961f\u5217\uff0c\u5b9e\u73b0\u62d6\u653e\u4e0a\u4f20<br \/>\n\t<strong>\u652f\u6301\u4e0a\u4f20\u8fdb\u5ea6<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;\u5f53\u6587\u4ef6\u88ab\u4e0a\u4f20\u65f6\uff0c\u8fdb\u5ea6\u6761\u663e\u793a\u5f53\u524d\u7684\u4e0a\u4f20\u8fdb\u5ea6\uff0c\u591a\u4e2a\u6587\u4ef6\u5206\u522b\u663e\u793a\u5404\u4e2a\u6587\u4ef6\u7684\u4e0a\u4f20\u8fdb\u5ea6<br \/>\n\t<strong>\u81ea\u5b9a\u4e49\u4e0a\u4f20\u9650\u5236<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;\u8bbe\u7f6e\u6587\u4ef6\u5927\u5c0f\u9650\u5236\uff0c\u6587\u4ef6\u8ba1\u6570\u9650\u5236\uff0c\u6587\u4ef6\u7c7b\u578b\u9650\u5236\uff0c\u540c\u65f6\u4e0a\u4f20\u9650\u5236\uff0c\u786e\u4fdd\u6211\u4eec\u7684\u670d\u52a1\u5668\u5b89\u5168<br \/>\n\t<strong>\u6700\u5927\u7a0b\u5ea6\u5b9a\u5236\u5316<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;Uploadify\u51e0\u4e4e\u5404\u65b9\u9762\u529f\u80fd\u90fd\u53ef\u4ee5\u5b8c\u5168\u5b9a\u5236\uff0c\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u8981\uff0c\u81ea\u7531\u5730\u521b\u5efa\u4f60\u786e\u5b9e\u9700\u8981\u7684uploader\u3002<br \/>\n\t\u5f53\u7136Uploadify\u4e5f\u6709\u7f3a\u9677\uff0c\u6bd4\u5982\u5f88\u591a\u6d4f\u89c8\u5668\u9ed8\u8ba4\u662f\u7981\u7528flash\u7684\uff0c\u4e5f\u4e0d\u652f\u6301\u65ad\u70b9\u4e0a\u4f20\u7b49\uff0c\u5b9e\u73b0\u4ee3\u7801\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:jscript;\">\r\n$(function() {\r\n&nbsp;&nbsp; &nbsp;$(&quot;#file_upload_1&quot;).uploadify({\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;height &nbsp; &nbsp; &nbsp; &nbsp;: 30,\/\/\u9ad8\u5ea6\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;swf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : &#039;\/uploadify\/uploadify.swf&#039;,\/\/\u6307\u5b9aswf\u6587\u4ef6\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;uploader &nbsp; &nbsp; &nbsp;: &#039;\/uploadify\/uploadify.php&#039;,\/\/\u540e\u53f0\u5904\u7406\u7684url\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;width &nbsp; &nbsp; &nbsp; &nbsp; : 120,\/\/\u5bbd\u5ea6\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;buttonText: &#039;\u4e0a\u4f20\u56fe\u7247&#039;, \/\/\u6309\u94ae\u663e\u793a\u7684\u6587\u5b57\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fileTypeExts: &nbsp;&#039;*.*&#039;,\/\/\u4e0a\u4f20\u6587\u4ef6\u7684\u7c7b\u578b,\u9ed8\u8ba4\u4e3a\u6240\u6709\u6587\u4ef6,\u591a\u4e2a\u7c7b\u578b\u4f7f\u7528;\u5206\u5272&#039;*.gif; *.jpg; *.png&#039;\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fileTypeDesc: &#039;Image Files&#039;,\/\/\u53ef\u9009\u62e9\u6587\u4ef6\u7684\u63cf\u8ff0,\u5728\u6d4f\u89c8\u7a97\u53e3\u5e95\u90e8\u7684\u6587\u4ef6\u7c7b\u578b\u4e0b\u62c9\u83dc\u5355\u4e2d\u663e\u793a\u7684\u6587\u672c\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;formData: {&#039;someKey&#039;:&#039;someValue&#039;,&#039;someOtherKey&#039;:1},\/\/\u53d1\u9001\u7ed9\u540e\u53f0\u7684\u5176\u4ed6\u53c2\u6570\u901a\u8fc7formData\u6307\u5b9a\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u4e0a\u4f20\u6587\u4ef6\u9875\u9762\u4e2d\uff0c\u4f60\u60f3\u8981\u7528\u6765\u4f5c\u4e3a\u6587\u4ef6\u961f\u5217\u7684\u5143\u7d20\u7684id, \u9ed8\u8ba4\u4e3afalse,\u81ea\u52a8\u751f\u6210,\u4e0d\u5e26#\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;queueID: &#039;fileQueue&#039;,\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;auto: true,\/\/\u9009\u62e9\u6587\u4ef6\u540e\u81ea\u52a8\u4e0a\u4f20\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;multi: true,\/\/\u8bbe\u7f6e\u4e3atrue\u5c06\u5141\u8bb8\u591a\u6587\u4ef6\u4e0a\u4f20\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;buttonClass:&#039;xttblog&#039;,\/\/\u4e0a\u4f20\u6309\u94ae\u7684\u6837\u5f0f\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;buttonImage:&#039;&#039;,\/\/\u6309\u94ae\u7684\u56fe\u7247\u8def\u5f84\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;buttonCursor:&#039;hand&#039;,\/\/\u9f20\u6807\u6307\u9488\u60ac\u505c\u5728\u6309\u94ae\u4e0a\u7684\u6837\u5b50\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;checkExisting:false,\/\/\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u68c0\u67e5\u76ee\u6807\u6587\u4ef6\u5939\u4e2d\u662f\u5426\u5df2\u4e0a\u8f7d\u7684\u6587\u4ef6\u7684\u540d\u79f0.\u5982\u679c\u6587\u4ef6\u540d\u4e0d\u5b58\u5728,\u8be5\u811a\u672c\u5c06\u8fd4\u56de1,\u5982\u679c\u6587\u4ef6\u540d\u5b58\u5728\u62160\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;debug:true,\/\/\u6253\u5f00swfupload\u8c03\u8bd5\u6a21\u5f0f\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fileObjName:&#039;&#039;,\/\/\u540e\u53f0\u83b7\u53d6\u6587\u4ef6\u5bf9\u8c61\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fileSizeLimit:&#039;&#039;,\/\/\u5141\u8bb8\u6587\u4ef6\u4e0a\u4f20\u7684\u6700\u5927\u5927\u5c0f.\u8fd9\u4e2a\u503c\u53ef\u4ee5\u662f\u6570\u5b57\u6216\u5b57\u7b26\u4e32.\u5982\u679c\u5b83\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32,\u5b83\u63a5\u53d7\u4e00\u4e2a\u5355\u4f4d(B,KB,MB,GB)\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u9ed8\u8ba4\u5355\u4f4d\u4e3aKB\u3002\u60a8\u53ef\u4ee5\u5c06\u6b64\u503c\u8bbe\u7f6e\u4e3a0,\u65e0\u9650\u5236\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;itemTemplate:&#039;&#039;,\/\/\u9009\u62e9\u4e0d\u540c\u7684HTML\u6a21\u677f,\u6dfb\u52a0\u4e0a\u4f20\u6587\u4ef6\u5230\u4e0a\u4f20\u961f\u5217\u3002\u4e3b\u8981\u67094\u79cd\u6a21\u677f:\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/instanceID(uploadify\u5b9e\u4f8bid)\u3001fileID(\u6587\u4ef6id)\u3001fileName(\u6587\u4ef6\u540d\u5b57)\u3001fileSize(\u6587\u4ef6\u5927\u5c0f).\u4f8b\u5982\uff1a${fileName}\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;method:&#039;POST&#039;,\/\/POST\u6216GET\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;overrideEvents:['onUploadProgress'],\/\/\u91cd\u5199\u4e8b\u4ef6,onUploadProgress\u8fdb\u5ea6\u6761\u4e0d\u66f4\u65b0\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;preventCaching:true,\/\/\u662f\u5426\u7f13\u5b58,\u9ed8\u8ba4\u4e3atrue\u4e0d\u7f13\u5b58\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;progressData:&#039;percentage&#039;,\/\/\u8fdb\u5ea6\u6761percentage\u767e\u5206\u767e\u3001speed\u4e0a\u4f20\u901f\u5ea6\u66f4\u65b0,\u9ed8\u8ba4\u4e3apercentage\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;queueID:false,\/\/\u9ed8\u8ba4\u4e3afalse\u961f\u5217id\u52a8\u6001\u751f\u6210,\u53ef\u4ee5\u4e3aDOM\u5143\u7d20\u7684id,\u8bbe\u7f6e\u961f\u5217\u6837\u5f0f\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;queueSizeLimit:999,\/\/\u961f\u5217\u5927\u5c0f\u9ed8\u8ba4\u4e3a999\uff0c\u8d85\u8fc7\u5c06\u89e6\u53d1onselecterror\u4e8b\u4ef6,\u548cuploadLimit\u7c7b\u4f3c\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;removeCompleted:true,\/\/\u9ed8\u8ba4\u4e3atrue\u4e0a\u4f20\u5b8c\u6210\u540e\u662f\u5426\u5220\u9664\u4e0a\u4f20\u961f\u5217\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;removeTimeout:3,\/\/\u4e0a\u4f20\u5b8c\u6210\u540e,\u5ef6\u8fdf3\u79d2\u5220\u9664\u961f\u5217\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;requeueErrors:true,\/\/\u9ed8\u8ba4\u4e3afalse,\u5982\u679c\u4e3atrue\u4e0a\u4f20\u5931\u8d25\u540e\u5c06\u7ee7\u7eed\u5c1d\u8bd5\u518d\u6b21\u4e0a\u4f20\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;successTimeout:30,\/\/\u6587\u4ef6\u4e0a\u4f20\u6210\u529f\u540e\u670d\u52a1\u7aef\u5e94\u8fd4\u56de\u6210\u529f\u6807\u5fd7\uff0c\u6b64\u9879\u8bbe\u7f6e\u8fd4\u56de\u7ed3\u679c\u7684\u8d85\u65f6\u65f6\u95f4\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;uploadLimit:999,\/\/\u6700\u5927\u4e0a\u4f20\u6587\u4ef6\u6570\u91cf\uff0c\u5982\u679c\u8fbe\u5230\u6216\u8d85\u51fa\u6b64\u9650\u5236\u5c06\u4f1a\u89e6\u53d1onUploadError\u4e8b\u4ef6\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onCancel : function(file) {\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u79fb\u9664\u6587\u4ef6\u65f6\u89e6\u53d1\r\n&nbsp; &nbsp; &nbsp; &nbsp; },\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onClearQueue:function(queueItemCount){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5f53\u8c03\u7528\u51fd\u6570cancel\u65b9\u6cd5\u65f6\u89e6\u53d1\uff0cqueueItemCount\u53c2\u6570\u4e3a\u88ab\u53d6\u6d88\u4e0a\u4f20\u7684\u6587\u4ef6\u6570\u91cf\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onDestroy:function(queueItemCount){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5f53destory\u65b9\u6cd5\u88ab\u8c03\u7528\u65f6\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onDialogClose:function(queueData){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5f53\u6587\u4ef6\u6d4f\u89c8\u6846\u5173\u95ed\u65f6\u89e6\u53d1\uff0c\u5982\u679c\u5c06\u6b64\u4e8b\u4ef6\u88ab\u91cd\u5199\uff0c\u5219\u5f53\u5411\u961f\u5217\u6dfb\u52a0\u6587\u4ef6\u4e0a\u4f20\u51fa\u9519\u65f6\u4e0d\u4f1a\u5f39\u51fa\u9519\u8bef\u6d88\u606f\u63d0\u793a\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/queueData\u5bf9\u8c61\u5305\u542b\u5982\u4e0b\u5c5e\u6027\uff1a\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/filesSelected \u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u4e2d\u5171\u9009\u62e9\u4e86\u591a\u5c11\u4e2a\u6587\u4ef6\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/filesQueued \u5df2\u7ecf\u5411\u961f\u5217\u4e2d\u6dfb\u52a0\u4e86\u591a\u5c11\u4e2a\u6587\u4ef6\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/filesReplaced \u5df2\u7ecf\u5411\u961f\u5217\u4e2d\u66ff\u6362\u4e86\u591a\u5c11\u4e2a\u6587\u4ef6\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/filesCancelled \u53d6\u6d88\u4e86\u591a\u5c11\u4e2a\u6587\u4ef6 filesErrored \u51fa\u9519\u4e86\u591a\u5c11\u4e2a\u6587\u4ef6\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onDialogOpen:function(){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5f53\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u5f39\u51fa\u65f6\u7acb\u5373\u51fa\u53d1\uff0c\u4f46\u53ef\u80fd\u5728\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u88ab\u5173\u95ed\u4e4b\u524d\u5e76\u4e0d\u80fd\u5168\u90e8\u6267\u884c\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onDisable:function(){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5f53disable\u65b9\u6cd5\u7981\u7528Uploadify\u4e0a\u4f20\u6309\u94ae\u65f6\u88ab\u8c03\u7528\u65f6\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onEnable:function(){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5f53disable\u65b9\u6cd5\u542f\u7528Uploadify\u4e0a\u4f20\u6309\u94ae\u65f6\u88ab\u8c03\u7528\u65f6\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onFallback:function(){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5f53Uploadify\u521d\u59cb\u5316\u8fc7\u7a0b\u4e2d\u68c0\u6d4b\u5230\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301flash\u65f6\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onInit:function(){\/\/\u9996\u6b21\u521d\u59cb\u5316Uploadify\u7ed3\u675f\u65f6\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onQueueComplete:function(queueData){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u6587\u4ef6\u4e0a\u4f20\u961f\u5217\u5904\u7406\u5b8c\u6bd5\u540e\u89e6\u53d1,queueData\u5bf9\u8c61\u5305\u542b\u5982\u4e0b\u5c5e\u6027\uff1a\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/uploadsSuccessful\u4e0a\u4f20\u6210\u529f\u7684\u6587\u4ef6\u6570\u91cf\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/uploadsErrored\u4e0a\u4f20\u5931\u8d25\u7684\u6587\u4ef6\u6570\u91cf\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onSelect:function(file){\/\/\u9009\u62e9\u6587\u4ef6\u540e\u5411\u961f\u5217\u4e2d\u6dfb\u52a0\u6bcf\u4e2a\u4e0a\u4f20\u4efb\u52a1\u65f6\u90fd\u4f1a\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onSelectError:function(file, errorCode, errorMsg){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u9009\u62e9\u6587\u4ef6\u540e\u5411\u961f\u5217\u4e2d\u6dfb\u52a0\u6bcf\u4e2a\u4e0a\u4f20\u4efb\u52a1\u65f6\u5982\u679c\u5931\u8d25\u90fd\u4f1a\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/file\u6587\u4ef6\u5bf9\u8c61\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/errorCode\u9519\u8bef\u4ee3\u7801\u5982\u4e0b\uff1a\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/QUEUE_LIMIT_EXCEEDED\u4efb\u52a1\u6570\u91cf\u8d85\u51fa\u961f\u5217\u9650\u5236\uff1b\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/FILE_EXCEEDS_SIZE_LIMIT\u6587\u4ef6\u5927\u5c0f\u8d85\u51fa\u9650\u5236\uff1b\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/ZERO_BYTE_FILE\u6587\u4ef6\u5927\u5c0f\u4e3a0\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/INVALID_FILETYPE\u6587\u4ef6\u7c7b\u578b\u4e0d\u7b26\u5408\u8981\u6c42\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/errorMsg\u9519\u8bef\u63d0\u793a\uff0c\u53ef\u901a\u8fc7&#039;this.queueData.errorMsg&#039;\u5b9a\u5236\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onSWFReady:function(){\/\/Flash\u6587\u4ef6\u8f7d\u5165\u6210\u529f\u540e\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onUploadComplete:function(file){\/\/\u6bcf\u4e2a\u6587\u4ef6\u4e0a\u4f20\u5b8c\u6bd5\u540e\u65e0\u8bba\u6210\u529f\u4e0e\u5426\u90fd\u4f1a\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onUploadError:function(file, errorCode, errorMsg, errorString){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u6587\u4ef6\u4e0a\u4f20\u51fa\u9519\u65f6\u89e6\u53d1\uff0c\u53c2\u6570\u7531\u670d\u52a1\u7aef\u7a0b\u5e8f\u8fd4\u56de\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onUploadProgress:function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5904\u7406\u4e0a\u4f20\u961f\u5217\u7684\u8fc7\u7a0b\u4e2d\u4f1a\u591a\u6b21\u89e6\u53d1\u6b64\u4e8b\u4ef6\uff0c\u6bcf\u5f53\u4efb\u52a1\u72b6\u6001\u6709\u66f4\u65b0\u65f6\u90fd\u4f1a\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/file\u6587\u4ef6\u5bf9\u8c61\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/bytesUploaded\u5df2\u4e0a\u4f20\u7684\u5b57\u8282\u6570\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/bytesTotal\u6587\u4ef6\u603b\u5b57\u8282\u6570\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/totalBytesUploaded\u5f53\u524d\u4efb\u52a1\u961f\u5217\u4e2d\u5168\u90e8\u6587\u4ef6\u5df2\u4e0a\u4f20\u7684\u603b\u5b57\u8282\u6570\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/totalBytesTotal\u5f53\u524d\u4efb\u52a1\u961f\u5217\u4e2d\u5168\u90e8\u6587\u4ef6\u7684\u603b\u5b57\u8282\u6570\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onUploadStart:function(file){\/\/\u5f53\u6587\u4ef6\u5373\u5c06\u5f00\u59cb\u4e0a\u4f20\u65f6\u7acb\u5373\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;onUploadSuccess:function(file, data, response){\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/\u5f53\u6587\u4ef6\u4e0a\u4f20\u6210\u529f\u65f6\u89e6\u53d1\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/file\u6587\u4ef6\u5bf9\u8c61\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/data\u670d\u52a1\u7aef\u8f93\u51fa\u8fd4\u56de\u7684\u4fe1\u606f\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\/\/response\u6709\u8f93\u51fa\u65f6\u4e3atrue,\u5982\u679c\u65e0\u54cd\u5e94\u4e3afalse\uff0c\u5982\u679c\u8fd4\u56de\u7684\u662ffalse,\u5f53\u8d85\u8fc7successTimeout\u8bbe\u7f6e\u7684\u65f6\u95f4\u540e\u5047\u5b9a\u4e3atrue\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}\r\n&nbsp;&nbsp; &nbsp;});\r\n});<\/pre>\n<p>\n\tuploadify\u65b9\u6cd5\u7528\u6cd5\u8be6\u89e3\uff1a<br \/>\n\t<strong>1.cancel(fileID, suppressEvent) \u53d6\u6d88\u961f\u5217\u4e2d\u7684\u4efb\u52a1\uff0c\u4e0d\u7ba1\u6b64\u4efb\u52a1\u662f\u5426\u5df2\u7ecf\u5f00\u59cb\u4e0a\u4f20<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;fileID\u8981\u53d6\u6d88\u7684\u6587\u4ef6ID\uff0c\u5982\u679c\u4e3a\u7a7a\u5219\u53d6\u6d88\u961f\u5217\u4e2d\u7b2c\u4e00\u4e2a\u4efb\u52a1\uff0c\u5982\u679c\u4e3a&#039;*&#039;\u5219\u53d6\u6d88\u6240\u6709\u4efb\u52a1<br \/>\n\t&nbsp;&nbsp; &nbsp;suppressEvent\u662f\u5426\u963b\u6b62\u89e6\u53d1onUploadCancel\u4e8b\u4ef6\uff0c\u5f53\u6e05\u7a7a\u961f\u5217\u65f6\u975e\u5e38\u5b9e\u7528<br \/>\n\t&nbsp;&nbsp; &nbsp;$(&#039;#file_upload&#039;).uploadify(&#039;cancel&#039;)\u53d6\u6d88\u7b2c\u4e00\u4e2a<br \/>\n\t&nbsp;&nbsp; &nbsp;$(&#039;#file_upload&#039;).uploadify(&#039;cancel&#039;,&#039;*&#039;)\u6e05\u7a7a\u961f\u5217<br \/>\n\t<strong>2.destroy()\u9500\u6bc1Uploadify\u5b9e\u4f8b\u5e76\u5c06\u6587\u4ef6\u4e0a\u4f20\u6309\u94ae\u6062\u590d\u5230\u539f\u59cb\u72b6\u6001<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;$(&#039;#file_upload&#039;).uploadify(&#039;destroy&#039;)\u9500\u6bc1Uploadify\u5b9e\u4f8b<br \/>\n\t<strong>3.disable(setDisabled)\u7981\u7528\u6216\u542f\u7528\u6587\u4ef6\u6d4f\u89c8\u6309\u94ae<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;setDisabled &ndash; \u8bbe\u7f6e\u4e3atrue\u8868\u793a\u7981\u7528\uff0cfalse\u4e3a\u542f\u7528<br \/>\n\t&nbsp;&nbsp; &nbsp;$(&#039;#file_upload&#039;).uploadify(&#039;disable&#039;,true)\u7981\u7528\u6309\u94ae<br \/>\n\t<strong>4.settings(name, value, resetObjects)\u83b7\u53d6\u6216\u8bbe\u7f6eUploadify\u5b9e\u4f8b\u53c2\u6570<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;name &ndash; \u5c5e\u6027\u540d\u79f0\uff0c\u5982\u679c\u53ea\u63d0\u4f9b\u5c5e\u6027\u540d\u79f0\u5219\u8868\u793a\u83b7\u53d6\u5176\u503c<br \/>\n\t&nbsp;&nbsp; &nbsp;value &ndash; \u5c5e\u6027\u503c<br \/>\n\t&nbsp;&nbsp; &nbsp;resetObjects &ndash; \u8bbe\u7f6e\u4e3atrue\u65f6\uff0c\u66f4\u65b0postData\u5bf9\u8c61\u5c06\u6e05\u7a7a\u73b0\u6709\u7684\u503c\u3002\u5426\u5219\uff0c\u65b0\u7684\u503c\u5c06\u88ab\u6dfb\u52a0\u5230\u5176\u672b\u5c3e<br \/>\n\t&nbsp;&nbsp; &nbsp;$(&#039;#file_upload&#039;).uploadify(&#039;settings&#039;,&#039;buttonText&#039;,&#039;BROWSE&#039;);<br \/>\n\t&nbsp;&nbsp; &nbsp;$(&#039;#file_upload&#039;).uploadify(&#039;settings&#039;,&#039;buttonText&#039;));<br \/>\n\t<strong>5.stop()\u505c\u6b62\u5f53\u524d\u6b63\u5728\u4e0a\u4f20\u7684\u4efb\u52a1<\/strong>&nbsp;&nbsp; &nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;$(&#039;#file_upload&#039;).uploadify(&#039;stop&#039;)\u505c\u6b62\u4e0a\u4f20<br \/>\n\t<strong>6.upload(fileID)\u7acb\u5373\u4e0a\u4f20\u6307\u5b9a\u7684\u6587\u4ef6<\/strong><br \/>\n\t&nbsp;&nbsp; &nbsp;\u5982\u679cfileID\u4e3a&rsquo;*&#039;\u8868\u793a\u4e0a\u4f20\u6240\u6709\u6587\u4ef6\uff0c\u8981\u6307\u5b9a\u4e0a\u4f20\u591a\u4e2a\u6587\u4ef6\uff0c\u5219\u5c06\u6bcf\u4e2a\u6587\u4ef6\u7684fileID\u4f5c\u4e3a\u4e00\u4e2a\u53c2\u6570<br \/>\n\t&nbsp;&nbsp; &nbsp;$(&#039;#file_upload&#039;).uploadify(&#039;upload&#039;,&#039;*&#039;)\u5f00\u59cb\u4e0a\u4f20\u6240\u6709\u6587<br \/>\n\t<strong>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u672a\u7ecf\u535a\u4e3b\u5141\u8bb8\u4e0d\u5f97\u8f6c\u8f7d\u3002<\/strong><\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=507\">Uploadify\u63d2\u4ef6\u7684\u53c2\u6570\u5c5e\u6027\u3001\u4e8b\u4ef6\u3001\u65b9\u6cd5\u51fd\u6570\u8be6\u89e3<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>Web\u4e0a\u4f20\u6587\u4ef6\u662f\u4e00\u4e2a\u5f88\u5e38\u7528\u7684\u529f\u80fd\uff0c\u8bd5\u7528\u8fc7\u4e0d\u5c11\u4e0a\u4f20\u7ec4\u4ef6\uff0c\u8981\u4e48\u662f\u6bcf\u6b21\u53ea\u80fd\u9009\u62e9\u4e00\u4e2a\u6587\u4ef6\uff0c\u8981\u4e48\u662f\u9009\u62e9\u4e86\u6587\u4ef6\u540e\u4e0d\u80fd\u53d6\u6d88\uff0c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[247,248,249,250,251],"class_list":["post-507","post","type-post","status-publish","format-standard","hentry","category-html5","tag-uploadify","tag-uploadify-js","tag-250","tag-251"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=507"}],"version-history":[{"count":2,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/507\/revisions"}],"predecessor-version":[{"id":509,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/507\/revisions\/509"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}