1/** 2* 컨ì¤í íì¤í ìì 3* @FileName File.js 4* @Creator consulting 5* @CreateDate 2017.03.08 6* @Desction 7************** ìì¤ ìì ì´ë ¥ *********************************************** 8* date Modifier Description 9******************************************************************************* 10* 2017.03.08 consulting ìµì´ ìì± 11* 2017.10.17 consulting 주ì ì ë¹ 12******************************************************************************* 13*/ 14 15var pForm = nexacro.Form.prototype; 16 17/** 18 * @class íì¬ Form ìì FileUpload ì»´í¬ëí¸ë¥¼ ìë²ì ì ë¡ëíë¤. <br> 19 * @param {Object} objFileUpload - íì¼ì ë¡ë ì»´í¬ëí¸ 20 * @param {String} [sUrl] - íì¼ì ë¡ë ìë¹ì¤ í¸ì¶ ê²½ë¡ 21 * @param {String} [sPath] - íì¼ì ë¡ëìí¬ í´ë ìì¹ 22 * @return N/A 23 * @example 24 * this.gfn_FileUpload(objFileUpload); 25 */ 26pForm.gfn_FileUpload = function(objFileUpload, sUrl, sPath) 27{ 28 var svcUrl = this.gfn_GetServerUrl(); 29 30 if (this.gfn_IsNull(sUrl)) sUrl = svcUrl; 31 32 //íì¼ì ë¡ë ìë¹ì¤ í¸ì¶ ê²½ë¡ 33 var sFileUrl = sUrl + "fileUpload.jsp"; 34 35 //íì¼ ì ë¡ë ìí¬ í´ë ìì¹ ì§ì 36 if (this.gfn_IsNull(sPath)) sPath = "PATH=upload"; 37 38 var bSucc = objFileUpload.upload(sFileUrl + "?" + sPath); 39 trace("bSucc >> " + bSucc); 40}; 41 42/** 43 * @class íì¬ Form ìì FileDownload ì»´í¬ëí¸ë¥¼ ì´ì©íì¬ ì§ì í ìì¹ìì ìíë íì¼ì ë¤ì´ë¡ëíë¤. <br> 44 * @param {Object} objFileDownload - íì¼ë¤ì´ë¡ë ì»´í¬ëí¸ 45 * @param {String} sFilename - ë¤ì´ë¡ë í íì¼ëª 46 * @param {String} [sUrl] - íì¼ì ë¡ë ìë¹ì¤ í¸ì¶ ê²½ë¡ 47 * @param {String} [sPath] - íì¼ì ë¡ëìí¬ í´ë ìì¹ 48 * @return N/A 49 * @example this.gfn_FileUpload(objFileUpload, sFilename); 50 */ 51pForm.gfn_FileDownload = function(objFileDownload, sFilename, sUrl, sPath) 52{ 53 var svcUrl = this.gfn_GetServerUrl(); 54 if (this.gfn_IsNull(sUrl)) sUrl = svcUrl; 55 56 57 //íì¼ë¤ì´ë¡ë ìë¹ì¤ í¸ì¶ ê²½ë¡ 58 var sFileUrl = sUrl + "fileDownload.jsp"; 59 60 //íì¼ ë¤ì´ë¡ëí í´ë ìì¹ ì§ì 61 if (this.gfn_IsNull(sPath)) sPath = "PATH=upload"; 62 63 objFileDownload.download(sFileUrl + "?" + sPath + "&file=" + sFilename); 64}; 65 66/** 67 * @class File Path 문ìì´(ì : C:\a\b\filename.ext)ìì Fileëª (ì : filename)ì ì¶ì¶ <br> 68 * @param {String} sPath - File Path 문ìì´ (ì : "C:\a\b\filename.ext") 69 * @param {String} bExt - extend를 returnëë Fileëª ì í¬í¨ìí¬ì§ ì¬ë¶ ( ìµì : Default=false ) 70 * @return {String} 71 * ì±ê³µ : <br> 72 * bExtê° trueì¸ ê²½ì° ==> sPathìì Fileëª (ì : "filename.ext") <br> 73 * bExtê° falseì¸ ê²½ì° ==> sPathìì Fileëª (ì : "filename") <br> 74 * ì¤í¨ : "" <br> 75 */ 76pForm.gfn_GetFileName = function (sPath, bExt) 77{ 78 var start_pos,end_pos,tmp_pos,filename; 79 80 if (this.gfn_IsNull(sPath)) 81 { 82 return ""; 83 } 84 if (this.gfn_IsNull(bExt)) 85 { 86 bExt = false; 87 } 88 89 start_pos = Math.max(this.gfn_PosReverse(sPath, "\\"), this.gfn_PosReverse(sPath, "/")); 90 tmp_pos = this.gfn_PosReverse(sPath, "::"); 91 if (tmp_pos > 0) 92 { 93 tmp_pos++; 94 } 95 start_pos = Math.max(start_pos, tmp_pos); 96 if (bExt == false) 97 { 98 end_pos = this.gfn_PosReverse(sPath, "."); 99 if (end_pos < 0) 100 { 101 end_pos = sPath.length; 102 } 103 filename = sPath.substr(start_pos + 1, end_pos - start_pos - 1); 104 } 105 else 106 { 107 filename = sPath.substr(start_pos + 1); 108 } 109 110 return filename; 111}; 112 113/** 114 * @description íµì ì¤ë¥ ì ë°ìíë ì´ë²¤í¸ì ëë¤ 115*/ 116pForm.gfn_Download_onerror = function(obj, e) 117{ 118 trace('gfn_Download_onerror'); 119 //ë°íììì e.errortype; <-- ìíë typeì´ ìë error object ê° ì ì¡ë¨. 120 trace("An error occurred: extDownload_onerror index=" + e.index + ", errortype=" + e.errortype + "\n, statuscode=" + e.statuscode + ", requesturi=" + e.requesturi); 121 122}; 123 124/** 125 * @description ë¤ì´ë¡ë ì±ê³µìì ë°ìíë ì´ë²¤í¸ì ëë¤ 126*/ 127pForm.gfn_Download_onsuccess = function(obj, e) 128{ 129 trace('gfn_Download_onsuccess'); 130 trace(" â extFileDownload_onsuccess url=" + e.url); 131 132 133 if(!this.gfn_IsNull(e.url)) 134 { 135 alert("Successfully downloaded."); 136 } 137 else 138 { 139 alert("ë¤ì´ë¡ë ì¤í¨"); 140 } 141 142}; 143/** 144 * @description [HTML5 Only] XMLHttpRequestê° ë°ì´í°ë¥¼ ë³´ë´ê±°ë ë°ë ëì ìë²ìì ì ìë ê°ê²©ì¼ë¡ ë°ìí©ëë¤. 145 * file upload & download ì§íì progress bar ì²ë¦¬ì© 146 * @param {ExtFileUpload} obj ExtFileUpload 147 * @param {ExtFileProgress} e ExtFileProgress 148*/ 149pForm.gfn_Download_onprogress = function(obj,e) 150{ 151 trace('gfn_Download_onprogress'); 152 if (e.lengthComputable) 153 { 154 155 } 156};
157/** 158 * @description [HTML5 Only] íì¼ë¤ì´ë¡ë 159 * @param {String} downUrl ë¤ì´ë¡ë fileUrl 160 * @param {String} fileName ë¤ì´ë¡ë íì¼ëª 161 * @return N/A 162*/ 163pForm.gfn_downloadFile = function(downUrl, fileName) 164{ 165 var name = this.gfn_GetUniqueId("gv_Download"); 166 if(this.gfn_IsNull(this.gv_Download)) 167 { 168 this.gv_Download = new nexacro.ExtFileDownload(name, this); 169 this.addChild(this.gv_Download.name, this.gv_Download); 170 171 this.gv_Download.addEventHandler("onsuccess", pForm.gfn_Download_onsuccess, false); 172 //íµì ì¤ë¥ ì ë°ìíë ì´ë²¤í¸ì ëë¤. 173 this.gv_Download.addEventHandler("onerror", pForm.gfn_Download_onerror, false); 174 //HTML5 Only : XMLHttpRequestê° ë°ì´í°ë¥¼ ë³´ë´ê±°ë ë°ë ëì ìë²ìì ì ìë ê°ê²©ì¼ë¡ ë°ìí©ëë¤. 175 this.gv_Download.addEventHandler("onprogress", pForm.gfn_Download_onprogress); 176 177 this.gv_Download.show(); 178 179 } 180 this.gv_Download.download(downUrl, fileName) 181};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.