fairnet/src/main/webapp/innorix_2/exam/dropZone.html
2024-10-30 18:19:30 +09:00

49 lines
1.9 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../innorix.css">
<script src="../innorix.js"></script>
<script>
var control = new Object();
var innoJquery = innorix._load("innoJquery");
window.onload = function() {
// 파일전송 컨트롤 생성
control = innorix.create({
el: '#fileControl', // 컨트롤 출력 HTML 객체 ID
installUrl: '../install/install.html', // Agent 설치 페이지
uploadUrl: './upload.jsp' // 업로드 URL
});
// 특정 html 객체를 파일추가용 DropZone 으로 활성
innoJquery("#dropZone").on({
"dragenter": function(innoJqueryevt) {
control.setDropZone(innoJqueryevt, this);
}
});
// 업로드 완료 이벤트
control.on('uploadComplete', function (p) {
var f = p.files;
var r = "Upload complete\n\n";
for (var i = 0; i < f.length; i++ ) {
r += f[i].clientFileName + " " + f[i].fileSize + "\n";
}
alert(r);
});
};
</script>
</head>
<body>
<a href="../index.html">&larr; 예제 목록</a><br /><br />
<table id="dropZone" style="width:555px; height:150px; border: 1px solid green">
<tr><td align="center">Drop files and folders here</td></tr>
</table><br /><br />
<div id="fileControl"></div><br/>
<input type="button" value="파일추가" onclick="control.openFileDialog();"/>
<input type="button" value="업로드" onclick="control.upload();"/>
</body>
</html>