Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
- <meta http-equiv="cache-control" content="max-age=0" />
- <meta http-equiv="cache-control" content="no-cache" />
- <meta http-equiv="expires" content="0" />
- <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
- <meta http-equiv="pragma" content="no-cache" />
- <meta name="msapplication-tap-highlight" content="no" />
- <meta http-equiv="x-ua-compatible" content="edge, chrome=1" />
- <meta name="mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <style type="text/css">
- body {
- width: 100%;
- height: 100%;
- background-color: #f5f5f5;
- margin: 0;
- padding: 0;
- font-family: Arial;
- font-size: 13px;
- color: #777777;
- user-select: none; -khtml-user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none;
- }
- .uploadButton {
- -moz-box-shadow: inset 0px 1px 0px 0px #ffffff;
- -webkit-box-shadow: inset 0px 1px 0px 0px #ffffff;
- box-shadow: inset 0px 1px 0px 0px #ffffff;
- background-color: #ededed;
- -webkit-border-top-left-radius: 5px;
- -moz-border-radius-topleft: 5px;
- border-top-left-radius: 5px;
- -webkit-border-top-right-radius: 5px;
- -moz-border-radius-topright: 5px;
- border-top-right-radius: 5px;
- -webkit-border-bottom-right-radius: 5px;
- -moz-border-radius-bottomright: 5px;
- border-bottom-right-radius: 5px;
- -webkit-border-bottom-left-radius: 5px;
- -moz-border-radius-bottomleft: 5px;
- border-bottom-left-radius: 5px;
- text-indent: 0;
- border: 1px solid #dcdcdc;
- display: inline-block;
- color: #777777;
- font-size: 13px;
- font-weight: bold;
- height: 30px;
- line-height: 30px;
- text-decoration: none;
- text-align: center;
- text-shadow: 1px 1px 0px #ffffff;
- min-width: 180px;
- padding-left: 10px;
- padding-right: 10px;
- overflow: visible;
- }
- .uploadButton:hover {
- background-color: #dfdfdf;
- }
- #fileTransfer a {
- color: #000000;
- }
- #fileTransfer a:hover {
- text-decoration: none;
- }
- .dropFi {
- background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGhlaWdodD0nNTAnIHdpZHRoPScxMjAnPjx0ZXh0IHg9JzE1JyB5PScxNScgZmlsbD0nZ3JleScgZm9udC1zaXplPScxMCc+RFJPUCBGSUxFUyBIRVJFITwvdGV4dD48L3N2Zz4=");
- background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGhlaWdodD0nNTAnIHdpZHRoPScxMjAnPjx0ZXh0IHg9JzE1JyB5PScxNScgZmlsbD0nZ3JleScgZm9udC1zaXplPScxMCc+RFJPUCBGSUxFUyBIRVJFITwvdGV4dD48L3N2Zz4=");
- width: 100%;
- height: 100%;
- background-color: #f5f5f5;
- margin: 0;
- padding: 0;
- font-family: Arial;
- font-size: 13px;
- color: #777777;
- }
- table tbody tr td {
- text-indent: 5px;
- color: #444;
- border-bottom: 1px solid #BBB;
- border-left: 1px solid #BBB;
- }
- table tbody tr .left, table thead tr .left {
- text-align: left;
- }
- table thead tr th {
- height: 20px;
- color: #777777;
- text-align: center;
- border-top: 1px solid #BBB;
- border-bottom: 1px solid #BBB;
- border-left: 1px solid #BBB;
- background-color: #EDEDED;
- }
- .right {
- cursor: pointer;
- }
- td {
- max-width: 0px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- </style>
- <script type="text/javascript">window.iefor = false;</script>
- <!--[if IE]><script type="text/javascript">window.iefor = true;</script><![endif]-->
- <script charset="utf-8" type="text/javascript">
- (function() {
- var WIND, DOC, OPR, INR = "inn"+"erH"+"TML";
- (function() { WIND = window; DOC = document; })();
- WIND.pIaReal = false;
- WIND.langString = false;
- try {
- if((OPR = "pa"+"re"+"nt") && WIND[OPR] && WIND[OPR].W && WIND[OPR].W !== WIND[OPR]) {
- WIND.langString = WIND[OPR].W.langstring;
- } else if((OPR = "ope"+"ne"+"r") && WIND[OPR] && WIND[OPR].W && WIND[OPR].W !== WIND[OPR]) {
- WIND.langString = WIND[OPR].W.langstring;
- } else { OPR = "undefined_1"; }
- } catch(e) { OPR = "pa"+"re"+"nt"; }
- (function() {
- var sTrA;
- try {
- if("sessionStorage" in WIND && (sTrA = WIND.sessionStorage)) {
- var varSess = "win_name_jwts";
- if(varSess in sTrA) {
- var kA = sTrA[varSess];
- if(kA && kA.length > 0) { WIND.name = kA; }
- }
- }
- } catch(exc) { }
- try {
- if(WIND.name.length > 0) {
- var pIaR = false;
- if(WIND[OPR] && WIND[OPR].W) {
- pIaR = WIND[OPR].W.my64Dec(WIND.name);
- }
- if(pIaR && pIaR.length > 0) {
- var hX = { };
- eval("function F(W) { var window=W; " + pIaR + " };F;")(hX);
- if(hX.pIaR) { WIND.pIaReal = hX.pIaR; }
- }
- }
- } catch(exc) { }
- })();
- WIND.uploadRulesSize = 0;
- WIND.uploadRulesExt = "";
- WIND.uploadRulesAllowExt = "";
- WIND.uploadRulesRun = "";
- WIND.lastClickType = 0;
- WIND.onStopProp = function(Ea) { if(!Ea) { Ea = WIND.event; if(!Ea) { return; } } if(Ea.stopPropagation) { Ea.stopPropagation(); } else { try { Ea.cancelBubble = true; } catch(a) { } } };
- WIND.loadmeBySoft = function() { };
- WIND.onerror = function(a, b, c, d) {
- try {
- if(WIND[OPR] && WIND[OPR].onerror) { return WIND[OPR].onerror(a, b, c, d); }
- } catch(exc) { }
- };
- WIND.endsWith = function(th, str) {
- return str.length > 0 && th.substring(th.length - str.length, th.length) === str;
- };
- WIND.myUploadExtRule = function(S) {
- var tC = S + "";
- while(tC.indexOf("|") == 0 || tC.indexOf("*") == 0) { tC = tC.substring(1); }
- while(WIND.endsWith(tC, "|")) { tC = tC.substring(0, tC.length - 1); }
- tC = tC.replace("|*.", ",.");
- return tC.replace("|", ",");
- };
- WIND.allFilesNumber = 0;
- WIND.ondragleave = WIND.ondrop = WIND.dragenter = WIND.ondragover = function(a) { return false; };
- var jsb64array = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- var sent = false;
- var DragHoverTimeout = false;
- WIND.jsencode64 = function(input) {
- var base64 = "";
- var hex = "";
- var chr1, chr2, chr3 = "";
- var enc1, enc2, enc3, enc4 = "";
- var i = 0;
- do {
- chr1 = input.charCodeAt(i++);
- chr2 = input.charCodeAt(i++);
- chr3 = input.charCodeAt(i++);
- enc1 = chr1 >> 2;
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
- enc4 = chr3 & 63;
- if(isNaN(chr2)) {
- enc3 = enc4 = 64;
- } else if(isNaN(chr3)) {
- enc4 = 64;
- }
- base64 = base64 +
- jsb64array.charAt(enc1) +
- jsb64array.charAt(enc2) +
- jsb64array.charAt(enc3) +
- jsb64array.charAt(enc4);
- chr1 = chr2 = chr3 = "";
- enc1 = enc2 = enc3 = enc4 = "";
- } while (i < input.length);
- return base64;
- }
- WIND.coSize = function(a) {
- if(a < 1025) {
- a += "B";
- } else if(a < 1048577) {
- a = ((a / 1024).toFixed(2)) + "KB";
- } else {
- a = ((a / 1048576).toFixed(2)) + "MB";
- }
- return a;
- }
- WIND.languaize = function() {
- try {
- var l;
- if((l = WIND.langString)) {
- if(l.owngu1) { DOC.getElementById("owngu1")[INR] = l.owngu1; }
- if(l.owngu2) { DOC.getElementById("owngu2")[INR] = l.owngu2; }
- }
- } catch(a) { }
- }
- var UNDEFINED = void 0;
- var allFiles = new Object();
- var allXhrFiles = new Object();
- WIND.firstload = function() {
- WIND.onclick = function(ev) { WIND.onStopProp(ev); WIND.loadme(2); return false; };
- try { DOC.getElementById("divfile").onclick = function(ev) { WIND.onStopProp(ev); WIND.loadme(3); return false; }; } catch(d) { }
- WIND.loadmeBySoft = function() { WIND.loadmeBySoft = function() { }; if(WIND.lastClickType < 2) { WIND.loadme(1); } };
- WIND.languaize();
- var W = WIND;
- try {
- (function() {
- if(!W.W) { W.W = W; }
- var mainW = (W[OPR] && W[OPR].W ? W[OPR].W : false);
- if(mainW) {
- if("uploadRulesSize" in mainW) { W.uploadRulesSize = mainW.uploadRulesSize; }
- if("uploadRulesExt" in mainW) { W.uploadRulesExt = mainW.uploadRulesExt; }
- if("uploadRulesAllowExt" in mainW) { W.uploadRulesAllowExt = mainW.uploadRulesAllowExt; }
- if("uploadRulesRun" in mainW) { W.uploadRulesExt = mainW.uploadRulesRun; }
- }
- var mainJquery = (W[OPR] && W[OPR].W && W[OPR].W.mainJquery ? W[OPR].W.mainJquery.toString() : false);
- if(mainJquery) {
- W.JQW = { };
- eval("mainJquery = " + mainJquery)(W.JQW, W);
- if(W.JQW.$) {
- W.$ = W.JQW.$;
- W.mainJquery = mainJquery;
- }
- }
- })();
- } catch(exc) { }
- try {
- (function() {
- if(W.pIaReal) {
- if("uploadRulesSize" in W.pIaReal) { W.uploadRulesSize = W.pIaReal.uploadRulesSize; }
- if("uploadRulesExt" in W.pIaReal) { W.uploadRulesExt = W.pIaReal.uploadRulesExt; }
- if("uploadRulesAllowExt" in W.pIaReal) { W.uploadRulesAllowExt = W.pIaReal.uploadRulesAllowExt; }
- if("uploadRulesRun" in W.pIaReal) { W.uploadRulesRun = W.pIaReal.uploadRulesRun; }
- }
- })();
- } catch(exc) { }
- var addOwnInner = "";
- var allFilesCounter = 1;
- var fg = DOC.getElementById("fileTransfer");
- var allAr = DOC.getElementsByTagName("body")[0];
- WIND.fg = fg;
- WIND.allAr = allAr;
- WIND.UploadMe = function(file, parentDirA, uploadRulesRun) {
- var xhr;
- try {
- if(WIND.myxhr) {
- xhr = WIND.myxhr;
- WIND.myxhr = false;
- } else {
- xhr = new WIND.XMLHttpRequest();
- }
- } catch (df) {
- return;
- }
- var nameown = "nameown" in file ? file.nameown : file.name;
- var myfile = allFilesCounter + nameown;
- allFiles[myfile] = parentDirA + nameown;
- var fullFileName = allFiles[myfile];
- allXhrFiles[myfile] = [xhr, false];
- allFilesCounter++;
- WIND.allFilesNumber++;
- var progress = false;
- var el;
- var op = DOC.getElementById("content");
- if(!op) {
- try {
- DOC.getElementById("divup")[INR] = "<div id='progress' style='text-align:center;'><table id='tabelle' width='100%' border='0' cellpadding='0' cellspacing='0'><thead><tr id='mainrow'><th style='width:57%;text-align:left;'> " + (!WIND.langString || !WIND.langString.ownglu1 ? "File Name" : WIND.langString.ownglu1) + "</th><th style='width:25%;'>" + (!WIND.langString || !WIND.langString.ownglu2 ? "Size" : WIND.langString.ownglu2) + "</th><th style='width:18%;cursor:pointer;'>" + (!WIND.langString || !WIND.langString.ownglu3 ? "Action" : WIND.langString.ownglu3) + "</th></tr></thead><tbody id='content'></tbody></table></div>";
- } catch (td) {}
- op = DOC.getElementById("content");
- }
- if(op) {
- el = DOC.createElement("tr");
- el[INR] = "<td class=\"left\">"+fullFileName+"</td><td>"+WIND.coSize(file.size)+"</td><td class=\"right\"></td>";
- op.appendChild(el);
- progress = el.childNodes[2];
- allXhrFiles[myfile][1] = progress;
- progress.onclick = function(a) {
- progress.onclick = null;
- try { allXhrFiles[myfile][0].abort(); } catch(ads) { }
- progress[INR] = !WIND.langString || !WIND.langString.owngu3 ? "Aborted" : WIND.langString.owngu3;
- WIND.onStopProp(a);
- return false;
- };
- var pcB = -1;
- if(progress) {
- xhr.upload.addEventListener("progress", function(e) {
- var pc = (e.loaded / e.total * 100) | 0;
- if(e.loaded == e.total) {
- progress[INR] = "100%";
- progress.onclick = null;
- progress = false;
- WIND.setTimeout(function() { op.removeChild(el); }, 1000);
- return;
- } else if(pcB != pc) {
- pcB = pc;
- progress[INR] = pc + "%";
- }
- }, false);
- }
- }
- try {
- DOC.getElementById("divfile").style.display = "none";
- } catch (td) {}
- WIND.onsubme();
- xhr.onreadystatechange = function(e) {
- if(xhr.readyState == 4) {
- try {
- allFiles[myfile] = UNDEFINED;
- allXhrFiles[myfile] = UNDEFINED;
- delete allFiles[myfile];
- delete allXhrFiles[myfile];
- } catch(oxs) {
- allFiles[myfile] = UNDEFINED;
- allXhrFiles[myfile] = UNDEFINED;
- }
- var k = 0;
- for(var p in allFiles) {
- if(allFiles[p] != UNDEFINED) {
- k++;
- }
- }
- WIND.allFilesNumber = k;
- progress.onclick = null;
- if(xhr.status == 200) {
- var specfilename = "";
- try {
- specfilename = xhr.getResponseHeader("Spec-Filename");
- } catch(exc) { specfilename = ""; }
- WIND.sendFinishUpload(WIND.realpathmain, fullFileName, specfilename, uploadRulesRun);
- } else if(xhr.status != 200) {
- try {
- if(progress[INR].indexOf((!WIND.langString || !WIND.langString.owngu3) ? "Aborted" : WIND.langString.owngu3) == -1) {
- var errstate = xhr.status;
- try {
- var errE = xhr.getResponseHeader("Spec-Error");
- if(errE) { errstate = errE; }
- } catch(exc) { }
- progress[INR] = "Err: " + errstate;
- }
- } catch(ad) { }
- }
- if(k == 0) {
- if(WIND.sent) {
- WIND.sent = false;
- WIND.onbeforeunload = WIND.onunload = null;
- try { var C = DOC.getElementById("mainrow").childNodes[2]; C.onclick = null; C[INR] = !WIND.langString || !WIND.langString.ownglu3 ? "Action" : WIND.langString.ownglu3; } catch(esd) { }
- }
- if(xhr.status == 200) {
- var hr = xhr.responseText;
- try {
- DOC.close();
- } catch(df) { }
- try {
- try {
- DOC.open("text/html", "replace");
- } catch(dfa) { DOC.open(); }
- WIND.fromGetUpload = true;
- DOC.write(hr);
- DOC.close();
- } catch(df) { }
- return;
- }
- WIND.setTimeout(function() { WIND.close(); }, 3000);
- }
- }
- };
- xhr.open("POST", WIND.action, true);
- try {
- xhr.setRequestHeader("X-File-Name", "base64" + WIND.jsencode64(encodeURIComponent(String(fullFileName))));
- } catch(dx) { }
- if(!WIND.sent) {
- WIND.sent = true;
- try {
- var C = DOC.getElementById("mainrow").childNodes[2];
- C[INR] = !WIND.langString || !WIND.langString.owngl4 ? "Abort" : WIND.langString.owngl4;
- C.onclick = function(s) {
- C.onclick = null;
- C[INR] = !WIND.langString || !WIND.langString.ownglu3 ? "Action" : WIND.langString.ownglu3;
- for(var p in allXhrFiles) {
- if(allXhrFiles[p] != UNDEFINED) {
- try {
- if(allXhrFiles[p][1]) {
- allXhrFiles[p][1].onclick = null;
- allXhrFiles[p][1][INR] = !WIND.langString || !WIND.langString.owngu3 ? "Aborted" : WIND.langString.owngu3;
- }
- allXhrFiles[p][0].abort();
- } catch(as) { }
- }
- }
- WIND.sent = false;
- WIND.onStopProp(s);
- return false;
- };
- } catch(esd) { }
- WIND.onbeforeunload = function(e) {
- if(WIND.sent) {
- return !WIND.langString || !WIND.langString.owngl6 ? "File transfer in progress!" : WIND.langString.owngl6;
- }
- };
- WIND.onunload = function(e) {
- if(WIND.sent) {
- try {
- var C = $("#mainrow")[0].childNodes[2];
- if(C && C.onclick) { C.onclick(e); }
- } catch(exc) { }
- }
- };
- }
- xhr.send(file);
- }
- WIND.DragHover = function(e) {
- var mytype;
- try {
- mytype = e.type;
- e.stopPropagation();
- e.preventDefault();
- } catch(exc) { return false; }
- if(DragHoverTimeout) { WIND.clearTimeout(DragHoverTimeout); }
- DragHoverTimeout = WIND.setTimeout(function() {
- DragHoverTimeout = false;
- if(fg) {
- if(WIND.sent) {
- return;
- }
- if(mytype == "dragover") {
- if(!WIND.beforeFG || fg[INR] != addOwnInner) {
- WIND.beforeFG = fg[INR];
- }
- fg.style.display = "none";
- if(allAr) {
- allAr.className = "dropFi";
- }
- } else if(WIND.beforeFG) {
- fg.style.display = "";
- if(allAr) {
- allAr.className = "";
- }
- }
- }
- }, 10);
- }
- WIND.ignoreDrag = function(e) {
- if(e && e.preventDefault) { e.preventDefault(); }
- };
- WIND.startsWith = function(th, str) {
- return str.length > 0 && th.substring(0, str.length) === str;
- };
- var endsWith = WIND.endsWith;
- var dirResolving = 0;
- WIND.SelectHandler = function(e) {
- if(e) {
- if(e.stopPropagation) { e.stopPropagation(); }
- if(e.preventDefault) { e.preventDefault(); }
- }
- var files, items;
- try {
- files = e.U_R || e.target.files || e.dataTransfer.files;
- items = (e.U_R_I ? e.U_R_I : (e.dataTransfer && e.dataTransfer.items ? e.dataTransfer.items : false));
- e.U_R = e.U_R_I = void 0;
- } catch(as) { }
- var uploadRulesSize = "uploadRulesSize" in e ? e.uploadRulesSize : WIND.uploadRulesSize;
- var uploadRulesExt = "uploadRulesExt" in e ? e.uploadRulesExt : WIND.uploadRulesExt;
- var uploadRulesAllowExt = "uploadRulesAllowExt" in e ? e.uploadRulesAllowExt : WIND.uploadRulesAllowExt;
- var uploadRulesRun = "uploadRulesRun" in e ? e.uploadRulesRun : WIND.uploadRulesRun;
- if(fg && WIND.beforeFG) {
- fg.style.display = "";
- if(allAr) {
- allAr.className = "";
- }
- }
- var directories = [], aGE = [ 0, 0 ], dirlen = 0, entry;
- dirResolving++;
- try {
- var name;
- for(var i = 0, f; f = files[i]; i++) {
- if(!("UPLOADING_" in f)) {
- f.UPLOADING_ = true;
- var found = false;
- if(!("name" in f)) { f.name = f.fileName; if(!("size" in f)) { f.size = f.fileSize; } }
- f.nameown = f.name;
- if(!found && (uploadRulesSize > 0 || uploadRulesExt.length > 0 || uploadRulesAllowExt.length > 0)) {
- if(uploadRulesSize > 0 && f.size > uploadRulesSize) { found = true; if(WIND.console && WIND.console.log) { WIND.console.log("getList size rule exception: " + (f.size - uploadRulesSize)); } }
- if(!found) {
- var uriLook = (f.nameown + "").toLowerCase();
- while(startsWith(uriLook, "\\") || startsWith(uriLook, "/")) { uriLook = uriLook.substring(1); }
- if(!endsWith(uriLook, "|")) { uriLook += "|"; }
- if(uriLook.length > 1 && !startsWith(uriLook, "|")) { uriLook = "|" + uriLook; }
- var allowUpload = true;
- if(uploadRulesAllowExt.length > 0) { //should prefer
- allowUpload = false;
- if(uploadRulesAllowExt.indexOf(uriLook) < 0) {
- var bO = uploadRulesAllowExt.split("|");
- for(var ii = 0; ii < bO.length; ii += 1) {
- if(bO[ii].length < 1) { continue; }
- var foundA = false;
- while(startsWith(bO[ii], "*")) { bO[ii] = bO[ii].substring(1); foundA = true; }
- if(!foundA) { bO[ii] = "|" + bO[ii]; }
- foundA = false;
- while(endsWith(bO[ii], "*")) { bO[ii] = bO[ii].substring(0, bO[ii].length - 1); foundA = true; }
- if(!foundA) { bO[ii] += "|"; }
- if(uriLook.indexOf(bO[ii]) > -1) { allowUpload = true; break; }
- }
- } else {
- allowUpload = true;
- }
- } else if(uploadRulesExt.indexOf(uriLook) < 0) {
- var bO = uploadRulesExt.split("|");
- for(var ii = 0; ii < bO.length; ii += 1) {
- if(bO[ii].length < 1) { continue; }
- var foundA = false;
- while(startsWith(bO[ii], "*")) { bO[ii] = bO[ii].substring(1); foundA = true; }
- if(!foundA) { bO[ii] = "|" + bO[ii]; }
- foundA = false;
- while(endsWith(bO[ii], "*")) { bO[ii] = bO[ii].substring(0, bO[ii].length - 1); foundA = true; }
- if(!foundA) { bO[ii] += "|"; }
- if(uriLook.indexOf(bO[ii]) > -1) { allowUpload = false; break; }
- }
- } else {
- allowUpload = false;
- }
- if(!allowUpload) {
- found = true;
- }
- }
- }
- try {
- var wasDir = false;
- if(items && items[i]) {
- try { entry = (items[i].webkitGetAsEntry ? items[i].webkitGetAsEntry() : (items[i].getAsEntry ? items[i].getAsEntry() : false)); } catch(abs) { entry = false; }
- if(entry && entry.isDirectory && entry.createReader) {
- wasDir = true;
- directories[dirlen++] = [ entry, entry.name ];
- }
- }
- if(!wasDir) {
- if(!found) { aGE[0]++; WIND.UploadMe(f, "", uploadRulesRun); }
- else {
- aGE[1]++;
- if(WIND.console && WIND.console.log) { WIND.console.log("getList extension rule exception: " + f.nameown); }
- }
- }
- } catch(kl) { }
- }
- }
- } catch(fkl) { }
- for(var i = 0; i < dirlen; i++) {
- try { WIND.uploadDirectory(aGE, directories[i][0], directories[i][1], uploadRulesSize, uploadRulesExt, uploadRulesAllowExt, uploadRulesRun); } catch(kl) { }
- }
- dirResolving--;
- if(!WIND.sent && dirResolving < 1 && aGE[0] == 0 && aGE[1] > 0) { WIND.close(); }
- };
- WIND.uploadDirectory = function(aGE, entry, parentDir, uploadRulesSize, uploadRulesExt, uploadRulesAllowExt, uploadRulesRun) {
- var directories = [], dirlen = 0, entry;
- var reader = entry.createReader();
- dirResolving++;
- reader.readEntries(function(entries) {
- for(var i = 0; i < entries.length; i++) {
- entry = entries[i];
- if(entry && entry.isDirectory && entry.createReader) {
- directories[dirlen++] = [ entry, entry.name ];
- } else if(entry.file) { //fetch file
- entry.file(function(f) {
- try {
- var found = false;
- if(!("name" in f)) { f.name = f.fileName; if(!("size" in f)) { f.size = f.fileSize; } }
- f.nameown = f.name;
- if(!found && (uploadRulesSize > 0 || uploadRulesExt.length > 0 || uploadRulesAllowExt.length > 0)) {
- if(uploadRulesSize > 0 && f.size > uploadRulesSize) { found = true; if(WIND.console && WIND.console.log) { WIND.console.log("getList size rule exception: " + (f.size - uploadRulesSize)); } }
- if(!found) {
- var uriLook = (f.nameown + "").toLowerCase();
- while(startsWith(uriLook, "\\") || startsWith(uriLook, "/")) { uriLook = uriLook.substring(1); }
- if(!endsWith(uriLook, "|")) { uriLook += "|"; }
- if(uriLook.length > 1 && !startsWith(uriLook, "|")) { uriLook = "|" + uriLook; }
- var allowUpload = true;
- if(uploadRulesAllowExt.length > 0) { //should prefer
- allowUpload = false;
- if(uploadRulesAllowExt.indexOf(uriLook) < 0) {
- var bO = uploadRulesAllowExt.split("|");
- for(var ii = 0; ii < bO.length; ii += 1) {
- if(bO[ii].length < 1) { continue; }
- var foundA = false;
- while(startsWith(bO[ii], "*")) { bO[ii] = bO[ii].substring(1); foundA = true; }
- if(!foundA) { bO[ii] = "|" + bO[ii]; }
- foundA = false;
- while(endsWith(bO[ii], "*")) { bO[ii] = bO[ii].substring(0, bO[ii].length - 1); foundA = true; }
- if(!foundA) { bO[ii] += "|"; }
- if(uriLook.indexOf(bO[ii]) > -1) { allowUpload = true; break; }
- }
- } else {
- allowUpload = true;
- }
- } else if(uploadRulesExt.indexOf(uriLook) < 0) {
- var bO = uploadRulesExt.split("|");
- for(var ii = 0; ii < bO.length; ii += 1) {
- if(bO[ii].length < 1) { continue; }
- var foundA = false;
- while(startsWith(bO[ii], "*")) { bO[ii] = bO[ii].substring(1); foundA = true; }
- if(!foundA) { bO[ii] = "|" + bO[ii]; }
- foundA = false;
- while(endsWith(bO[ii], "*")) { bO[ii] = bO[ii].substring(0, bO[ii].length - 1); foundA = true; }
- if(!foundA) { bO[ii] += "|"; }
- if(uriLook.indexOf(bO[ii]) > -1) { allowUpload = false; break; }
- }
- } else {
- allowUpload = false;
- }
- if(!allowUpload) {
- found = true;
- if(WIND.console && WIND.console.log) { WIND.console.log("getList extension rule exception: " + f.nameown); }
- }
- }
- }
- if(!found) { aGE[0]++; WIND.UploadMe(f, parentDir + "/", uploadRulesRun); } else { aGE[1]++; }
- } catch(ex) { }
- }, function(er) { });
- }
- }
- for(var i = 0; i < dirlen; i++) {
- try { WIND.uploadDirectory(aGE, directories[i][0], parentDir + "/" + directories[i][1], uploadRulesSize, uploadRulesExt, uploadRulesAllowExt, uploadRulesRun); } catch(kl) { }
- }
- dirResolving--;
- if(!WIND.sent && dirResolving < 1 && aGE[0] == 0 && aGE[1] > 0) { WIND.close(); }
- }, function(err) { });
- };
- WIND.MySelectHandler = SelectHandler;
- var myExtRuleClean = WIND.myUploadExtRule(WIND.uploadRulesAllowExt);
- var forma = DOC.getElementById("forform");
- var fortxt = "<br><br><fo"+"rm id=\"frm1\" ac"+"tion=\"" + WIND.action + "\" method=\"post\" enctype=\"multipart/form-data\">";
- fortxt += " <input id=\"file\" style=\"position:absolute;left:-9999px;\" onchange=\"window.setme();window.clearValue(this);\" type=\"file\" " + (myExtRuleClean && myExtRuleClean.length > 0 ? "accept=\"" + myExtRuleClean + "\" " : "") + "name=\"file[]\" multiple />";
- fortxt += "<input id=\"mysubmit\" style=\"position:absolute;left:-9999px;\" type=\"button\" onmousedown=\"window.formSubmit(true);\" value=\"SEND\" />";
- fortxt += "</form><br><br><br><br><br><br><br><br><br><br>";
- if(WIND.File && WIND.FileList && WIND.FileReader) {
- try {
- WIND.myxhr = new WIND.XMLHttpRequest();
- var filedrag = allAr;
- if(filedrag && WIND.myxhr.upload) {
- fortxt = "<br><br><fo"+"rm id=\"frm1\" act"+"ion=\"" + WIND.action + "\" method=\"post\" enctype=\"multipart/form-data\">";
- fortxt += " <input id=\"file\" style=\"position:absolute;left:-9999px;\" onchange=\"window.MySelectHandler(event);window.clearValue(this);\" type=\"file\" " + (myExtRuleClean && myExtRuleClean.length > 0 ? "accept=\"" + myExtRuleClean + "\" " : "") + "name=\"file[]\" multiple />";
- fortxt += "</form><br><br><br><br><br><br><br><br><br><br>";
- WIND.ondragleave = WIND.ondrop = WIND.dragenter = WIND.ondragover = null;
- WIND.addEventListener("dragleave", DragHover, false);
- WIND.addEventListener("drop", SelectHandler, false);
- WIND.addEventListener("dragenter", ignoreDrag, false);
- WIND.addEventListener("dragover", function(a) { try { var effect = a.dataTransfer.effectAllowed; a.dataTransfer.dropEffect = ("move" === effect || "linkMove" === effect ? "move" : "copy"); } catch(asd) { } }, false);
- WIND.addEventListener("dragover", DragHover, false);
- WIND.onblur = function() {
- if(WIND.fg) {
- WIND.fg.style.display = "";
- if(WIND.allAr) {
- WIND.allAr.className = "";
- }
- }
- }
- WIND.blur = WIND.onblur;
- WIND.onmouseout = WIND.onblur;
- }
- } catch(xn) { }
- }
- if(forma) {
- try {
- forma[INR] = fortxt;
- } catch(d) {
- try {
- var trA = $(fortxt);
- if(trA && trA.length) {
- for(var ii = 0; ii < trA.length; ii += 1) {
- content.appendChild(trA[ii]);
- }
- }
- } catch(exc2) { }
- }
- try { DOC.getElementById("file").onclick = WIND.onStopProp; } catch(d) { }
- }
- WIND.setTimeout(function() {
- var pr = false;
- try {
- if(WIND[OPR] && WIND[OPR].W) {
- pr = WIND[OPR];
- }
- } catch(ex) { pr = false; }
- if(!pr) { return; }
- WIND.setInterval(function() {
- try {
- if(!WIND.sent) {
- if(!pr || pr.closed) {
- self.close();
- }
- }
- } catch(exc) { }
- }, 5000);
- }, 5000);
- };
- WIND.loadme = function(from) {
- if(WIND.iefor) { //on ie6-8 click on divfile does not work
- try { DOC.getElementById("file").style.left = ""; } catch (d) { return; }
- } else {
- try { DOC.getElementById("divfile").style.display = ""; } catch (d) { return; }
- }
- if(from == 0) { return false; }
- WIND.lastClickType = from;
- var filed = DOC.getElementById("file");
- try {
- filed.focus();
- filed.click();
- } catch(d) { }
- };
- WIND.setme = function() {
- var text = DOC.getElementById("file").value;
- if(text.length > 0) {
- text = text.replace("C:\\fakepath\\", "");
- try { DOC.getElementById("divfile")[INR] = text; } catch(d) { return; }
- WIND.formSubmit(false);
- }
- };
- WIND.clearValue = function(a) {
- if(!a) { a = DOC.getElementById("file"); }
- if(a) { try { a.value = ""; } catch(exc) { } }
- };
- WIND.onsubme = function() {
- DOC.getElementById("divup").style.display = "";
- };
- WIND.formSubmit = function(from) {
- try {
- if(DOC.getElementById("file").value.length < 1) {
- return;
- }
- if(!WIND.sent) {
- WIND.onsubme();
- DOC.getElementById("frm1").submit();
- WIND.sent = true;
- }
- } catch (e) {
- if(DOC.getElementById("mysubmit") != null) {
- DOC.getElementById("mysubmit").style.left = "";
- }
- if(from) {
- WIND.formSubmit(false);
- }
- }
- };
- WIND.sendFinishUpload = function(a, f, d, u) {
- try {
- if(WIND[OPR] && WIND[OPR].W) {
- WIND[OPR].W.sendFinishUpload(a, f, WIND.allFilesNumber, d, u);
- }
- } catch(e) { }
- };
- })();
- </script>
- </head>
- <body onload="window.firstload();window.loadme(0);">
- <div id="allArea">
- <br>
- <div id="fileTransfer">
- <div id="divfile" style="text-align:center;display:none;">
- <a id="owngu1" draggable="false" href="#" class="uploadButton">Click here to select your file!</a>
- </div>
- <div id="divup" style="text-align:center;display:none;">
- <p id="owngu2" style="line-height: 24px;">Uploading file, please wait..</p>
- </div>
- </div>
- <div id="forform" style="text-align:left;"></div>
- </div>
- <div id="allErr" style="text-align:center;display:none;"></div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment