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

57 lines
2.5 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();
window.onload = function() {
// 파일전송 컨트롤 생성
control = innorix.create({
el: '#fileControl', // 컨트롤 출력 HTML 객체 ID
transferMode: 'both', // 업로드, 다운로드 혼합사용
installUrl: '../install/install.html', // Agent 설치 페이지
uploadUrl: './upload.jsp', // 업로드 URL
isDebugDropZone: true //드랍존 영역 표시
});
/*
isDebugDropZone (※ Agent 모드 전용 옵션)
- true (파일을 드랍존으로 드래그하면 드랍존이 검은색으로 표시)
*/
// 업로드 완료 이벤트
control.on('uploadComplete', function (p) {
console.log(p.files);
var f = p.files;
var r = "Upload complete\n\n";
for (var i = 0; i < f.length; i++ ) {
r += f[i].controlId + " " + f[i].clientFileName + " " + f[i].fileSize + "\n";
}
alert(r);
var files = JSON.stringify(f);
var innoJquery = innorix._load("innoJquery");
innoJquery('form#f_write').append('<input type="hidden" name="files" id="files" value=\'' + files + '\' />');
innoJquery('form#f_write').submit();
});
};
</script>
</head>
<body>
<a href="../gnIndex.html">&larr; 예제 목록</a><br /><br />
<p>설정된 드랍존 영역을 확인하는 방법 - 파일을 드래그하여 드랍존 영역을 확인할 수 있습니다.<p>
<form action="result.jsp" id="f_write" name="f_write" method="post">
test1 : <input type="text" name="test1" />
</form><br />
<div id="fileControl"></div><br/>
<input type="button" value="멀티 파일 추가" onclick="control.openFileDialog();"/>
<input type="button" value="단일 파일 추가" onclick="control.openFileDialogSingle();"/>
<input type="button" value="업로드" onclick="control.upload();"/>
</body>
</html>