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

1 line
2.3 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
});
// 업로드 완료 이벤트
control.on('uploadComplete', function (p) {
alert("업로드가 완료 되었습니다.\n다운로드 가능하게 재구성 합니다.");
var urlBase = location.href.substring(0, location.href.lastIndexOf("/") + 1);
var fileArray = new Array();
var f = p.files;
for (var i = 0; i < f.length; i++ ) {
var fileObj = new Object();
fileObj.printFileName = f[i].clientFileName;
fileObj.fileSize = f[i].fileSize;
fileObj.downloadUrl = urlBase + "download.jsp?fileName=" + f[i].serverFileName;
fileArray.push(fileObj);
}
console.log(fileArray);
control.removeAllFiles(); // 리스트 컨트롤에서 파일을 삭제
control.presetDownloadFiles(fileArray); // 다운로드 목록을 구성
});
};
</script>
</head>
<body>
<a href="../index.html">&larr; 예제 목록</a><br /><br />
<div id="fileControl"></div><br/>
<input type="button" value="파일추가" onclick="control.openFileDialog();"/>
<input type="button" value="업로드" onclick="control.upload();"/> |
<input type="button" value="선택파일 다운로드" onclick="control.downloadSelectedFiles();"/>
<input type="button" value="전체 다운로드" onclick="control.download();"/>
</body>
</html>