This repository was archived by the owner on Nov 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_frame.html
More file actions
executable file
·130 lines (108 loc) · 4.02 KB
/
upload_frame.html
File metadata and controls
executable file
·130 lines (108 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Codejune WebStorage</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta http-equiv="expires" content="mon, 06 jan 1990 00:00:01 GMT" />
<LINK REL="SHORTCUT ICON" HREF="/$skin/images/startup.png?action=SkinFile">
<LINK REL="SHORTCUT ICON" HREF="/$skin/images/startup.ico?action=SkinFile">
</head>
<body bgcolor="#FFFFFF" style='margin:0'>
<div style='background-color:#009688; color:#ffffff; font-weight:bold; font-size:18px; padding:5px;'>
Codejune WebStorage
</div>
<div id='uploadPath' style='margin:10px; font-size:9pt;'></div>
<div id='uploadForm' style='margin:10px;'></div>
<div id='statusText' style='margin:10px; padding:5px; font-size:9pt; display:none;'></div>
<div id='statusProgress' style='margin-left:10px; margin-right:10px; font-size:9pt; display:none;'></div>
<div id='statusStream' style='display:none;'></div>
<script src="/$skin/sortabletable.js?action=SkinFile"></script>
<script language="JavaScript" type="text/javascript">
/////////////////////////////////////////////////////////////////////////////
// LIBRARY: UTF8URLDecode
function UTF8URLDecode( req )
{
var bytes = new Array;
var percentCode = "%".charCodeAt(0);
// phase 1. req를 byte array로 변환
for( i=0; i<req.length; i++ )
{
var c;
if( req.charCodeAt(i) == percentCode )
{
c = parseInt( req.substr(i+1, 2), 16 );
i += 2;
}
else
{
c = req.charCodeAt(i);
}
bytes[bytes.length] = c;
}
var result = "";
// phase 2. byte array를 조합하여 UCS2로 전환
for( i=0; i<bytes.length; i++ )
{
var ch;
if( (bytes[i]&0x80) == 0 )
{
ch = bytes[i];
}
else if( (bytes[i]&0xe0) == 0xC0 )
{
ch = ((bytes[i] & 0x1f) << 6) | (bytes[i+1] & 0x3f);
i++;
}
else if( (bytes[i]&0xf0) == 0xe0 )
{
ch = ((bytes[i] & 0x0f) << 12) | ((bytes[i+1] & 0x3f) << 6) | (bytes[i+2] & 0x3f);
i += 2;
}
result += String.fromCharCode(ch);
}
return result;
}
function IsOpera()
{
return ( navigator.userAgent.toLowerCase().indexOf('opera') != -1 );
}
if( IsOpera() )
{
alert("업로드할 파일을 선택해 주십시오.");
}
var loc = "" + document.location;
var urlPath = loc.split('#')[1].split('*')[0];
var plainPath = UTF8URLDecode(urlPath);
var skinName = loc.split('#')[1].split('*')[1];
document.getElementById('uploadPath').innerHTML = "업로드 폴더: " + plainPath;
document.getElementById('uploadForm').innerHTML = "<iframe src='/"+skinName+"/upload_form.html?action=SkinFile#" + urlPath + "' width='97%' height='130px' scrolling='auto' frameborder='0'/>";
function onBeginUpload( filename, key )
{
self.resizeTo(750, 200);
document.getElementById('uploadForm').style.display = 'none';
document.getElementById('statusText').style.display = 'block';
document.getElementById('statusProgress').style.display = 'block';
document.getElementById('statusStream').innerHTML = "<iframe src='./?action=UploadStatus&key=" + key + "'/>";
}
function onUpdateUpload( text, percentage )
{
document.getElementById('statusText').innerHTML = text;
}
function onUpdateProgress( percentage )
{
document.getElementById('statusProgress').innerHTML =
"<table cellpadding='0' cellspacing='1' height='10' width='100%' height='20' style='border:1px solid black;'>" +
" <tr>" +
" <td style='font-size:5px; background:#5A82D6;' width='"+percentage+"%'> </td>" +
" <td style='font-size:5px; background:white;' width='"+(100-percentage)+"%'> </td>" +
" </tr>" +
"</table>" ;
// alert(document.getElementById('statusProgress').innerHTML);
}
/////////////////////////////////////////////////////////////////////////////
</script>
</body>
</html>