123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SPZZZ00600" classname="SPZZZ00600_파일다운로드" inheritanceid="" position="absolute 0 0 330 127" titletext="파일다운로드" oninit="SPZZZ00600_oninit" onload="SPZZZ00600_onload" onactivate="SPZZZ00600_onactivate" onbeforeclose="SPZZZ00600_onbeforeclose">
- <Layouts>
- <Layout>
- <Div id="div_download" taborder="0" style="background:blanchedalmond URL('..\..\..\IMAGES\com\filedownbg.png');border:1 solid black ;shadow:outer 5,5 5 gray;" visible="false" position="absolute 0 0 322 118">
- <Layouts>
- <Layout>
- <ProgressBar id="ProgressBar00" taborder="1" text="0 %" max="100" min="0" blockgap="3" blocksize="292" position="absolute 14 52 306 74" style="color:black;bordertype:round 5 5 ;font:Dotum,11,bold;opacity:60;"/>
- <Static id="Static00" text="다운로드 준비중..." position="absolute 15 29 123 49" anchor="default"/>
- <Button id="btn_ok" taborder="2" text="확인" position="absolute 166 82 232 102" class="btn2" enable="false" onclick="div_download_btn_ok_onclick" anchor="default"/>
- <Button id="btn_cancel" taborder="3" text="취소" class="btn2" position="absolute 240 82 306 102" onclick="div_download_btn_cancel_onclick" anchor="default"/>
- <Static id="stt_mcnt" text="(0 / 0)" position="absolute 115 29 183 49" visible="false"/>
- </Layout>
- </Layouts>
- </Div>
- </Layout>
- </Layouts>
- <Objects>
- <HttpObject asyncflag="true" id="HttpObject00" retry="10" onstatus="HttpObject00_onstatus" timeout="30000" onload="HttpObject00_onload"/>
- </Objects>
- <Script type="xscript4.0"><![CDATA[include "com_commonxp::comm_main.xjs";
- var vFile_down = null;
- var nMultiDownloadCnt = 0;
- function SPZZZ00600_oninit(obj:Form, e:InitEventInfo)
- {
-
- }
- function SPZZZ00600_onload(obj:Form, e:LoadEventInfo)
- {
- // trace(sysf_getActionURL(arg_submitid) + "&filepath=" + arg_filepath);
-
- HttpObject00._showui = arg_showui;
-
- fStartDownload();
- }
- function fStartDownload() {
- if(arg_showui) {
- div_download.ProgressBar00.pos = 0;
- div_download.ProgressBar00.text = "0 %";
- div_download.Static00.text = "다운로드 준비중...";
- div_download.btn_ok.enable = false;
- div_download.btn_cancel.enable = true;
- div_download.visible = true;
- }
-
- if(arg_multi) {
- div_download.stt_mcnt.text = "(" + (nMultiDownloadCnt + 1) + " / " + arg_filepath.length + ")";
- div_download.stt_mcnt.visible = true;
-
- var filenm = arg_filepath[nMultiDownloadCnt].split(/\/|\\/); // / 또는 \ 로 split 하여 마지막 항목을 default 파일 명으로 사용한다.
- var len = filenm.length;
- filenm = filenm[len-1];
-
- vFile_down = new VirtualFile();
- vFile_down.open(arg_localfile + "\\" + filenm, VirtualFile.openWrite);
-
- try { // 취소 버튼 눌러서 강제 종료시 에러 방지
- HttpObject00.download(sysf_getActionURL(arg_submitid) + "&filepath=" + arg_filepath[nMultiDownloadCnt], vFile_down, true);
- } catch(e) {}
- } else {
- try { // 취소 버튼 눌러서 강제 종료시 에러 방지
- HttpObject00.download(sysf_getActionURL(arg_submitid, true) + "&filepath=" + arg_filepath, arg_localfile, true);
- } catch(e) {}
- }
- }
- function HttpObject00_onload(obj:HttpObject, e:HttpObjLoadEventInfo) {
- //trace("e.errorcode : " + e.errorcode);
-
- if(!utlf_isNull(vFile_down)) vFile_down.close();
-
- div_download.btn_ok.enable = true;
- div_download.btn_cancel.enable = false;
-
- if(e.errorcode == 0) { // 성공
- if(obj._showui) {
- div_download.Static00.text = "다운로드 완료";
- }
- } else { // 실패
- if(obj._showui) {
- div_download.Static00.text = "다운로드 실패";
- return;
- }
- }
-
- if(arg_multi) {
- if(++nMultiDownloadCnt < arg_filepath.length) {
- fStartDownload();
- }
- }
- }
- function HttpObject00_onstatus(obj:HttpObject, e:HttpObjStatusEventInfo) {
- //trace("e.status : " + e.status);
-
- if(obj._showui) {
- div_download.ProgressBar00.pos = e.status;
- div_download.ProgressBar00.text = e.status + " %";
-
- if(e.status == 1) {
- div_download.Static00.text = "다운로드 중...";
- }
- }
- }
- function div_download_btn_ok_onclick(obj:Button, e:ClickEventInfo)
- {
- this.close();
- }
- function div_download_btn_cancel_onclick(obj:Button, e:ClickEventInfo)
- {
- this.close();
- }
- function SPZZZ00600_onactivate(obj:Form, e:ActivateEventInfo)
- {
- frmf_setFocusOpener();
- }
- function SPZZZ00600_onbeforeclose(obj:Form, e:CloseEventInfo)
- {
- if(!utlf_isNull(vFile_down)) vFile_down.close();
- }
- ]]></Script>
- </Form>
- </FDL>
|