You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

145 lines
4.2 KiB

<%
/**********************************************************************************
프로그램명 : write_file_upload.jsp
프로그램설명 :
작 성 자 :
작 성 일 :
최신변경일 :
***********************************************************************************/
%>
<%@ page contentType="text/html; charset=euc-kr"%>
<%@ page import="java.net.*"%>
<%@ page import="kr.co.kihyun.lang.Encoder"%>
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>
<%
try{
/****** Parameter ******/
String execMode = "";
String svrFilename = "";
String usrFilename = "";
String boardGroupID = "";
execMode = request.getParameter("execMode");
svrFilename = Encoder.toJava(request.getParameter("svrFilename"));
usrFilename = Encoder.toJava(request.getParameter("usrFilename"));
String docID = request.getParameter("docID");
String deptID = request.getParameter("deptID");
String chkExt="";
if(execMode!="init"){
chkExt=checkext(svrFilename,"");
if(chkExt.equals("false")){
execMode="error";
}
chkExt=checkext(usrFilename,"");
if(chkExt.equals("false")){
execMode="error";
}
}
%>
<html>
<head>
<META http-equiv="Content-Type"
content="text/html; charset=ks_c_5601-1987">
<link rel="stylesheet" href="/totsys/common/css/text.css"
type="text/css">
<script src="/totsys/common/js/rollover.js"></script>
<script language="javascript">
<!--
function checkVal() {
var frm = document.upFrm
if (frm.appendFile.value == ""){
alert ('먼저 찾아보기 버튼을 눌러 이미지를 선택해주세요.');
return;
}else if(parent.num > 4){
alert ('5개까지만 첨부 가능 합니다.');
return;
}
frm.submit();
}
function exec(execMode){
if(execMode == "up"){
//파일 업로드 모드
parent.checkFile('<%= svrFilename %>', '<%= usrFilename %>');
this.location='./write_file_upload.jsp?execMode=init&docID=<%=docID%>&deptID=<%=deptID%>';
}else if(execMode == "del"){
//파일 삭제 모드
alert("파일이 삭제 되었습니다.");
}else if(execMode == "init"){
//초기 실행 모드
}else if(execMode == "jump"){
this.location='./write_file_upload.jsp?execMode=init&docID=<%=docID%>&deptID=<%=deptID%>';
}else{
alert("잘못된값이 입력되었습니다. 다시 시도 하여 주세요.");
return;
}
}
document.write ("<font style=\"font-size:9pt; line-height: 1.3;\" color=565656>-'찾아보기'후 '추가'버튼 클릭<br>");
document.write ("- 파일당 10Mb이내, 5개까지 업로드 가능</font>");
//-->
</script>
</head>
<body style='' onload="exec('<%= execMode %>');">
<table cellSpacing="0" cellPadding="0" width="405" align="left" border=0>
<!-- form upFrm -->
<form action='/servlet/kr.co.kihyun.beans.totsys.report.HttpFileUpload'
name='upFrm' enctype='multipart/form-data' method='post'><input
type='hidden' name='docID' value='<%=docID%>'> <input
type='hidden' name='deptID' value='<%=deptID%>'>
<tr>
<td width="355" align="left"><input type=file size="65"
name="appendFile" class="inputtxt">&nbsp;</td>
<td nowrap width="35" valign="top" align="right"><a href="#"><img
src="/totsys/common/images/bt_file_append.gif" onClick="checkVal();"
border=0></a></td>
</tr>
</form>
<tr>
<td nowrap height="4"></td>
<td></td>
</tr>
<!-- form delFrm -->
<form action='/servlet/kr.co.kihyun.beans.totsys.report.HttpFileDelete'
name='delFrm' method='post'><input type='hidden' name='docID'
value='<%=docID%>'> <input type='hidden' name='deptID'
value='<%=deptID%>'>
<tr>
<td align="left"><select name='fileList' size=6 class="inputtxt">
<option selected value="-1">----------------------------------------
첨부파일 리스트 ---------------------------------------</option>
<script>
usrFilenameList = parent.usrFilenames.split(";", parent.num);
svrFilenameList = parent.svrFilenames.split(";", parent.num);
for (i=0; i<parent.num; i++){
document.write ("<option value='" + svrFilenameList[i] + "'>" + usrFilenameList[i].substr(0, 20) + "</option>");
}
</script>
</select></td>
<td valign="top" align="right"><a href="#"><img
src="/totsys/common/images/bt_file_del.gif" border="0" name='delBtn'
onClick='parent.delFrm();'></a><br>
</td>
</tr>
</form>
</table>
</body>
</html>
<%
}catch(Exception ex){
ex.printStackTrace();
}
%>