DELETEFILE.jsp 3.43 KB
Newer Older
Thitichaipun Wutthisak committed
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
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*"%>
<%@page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"  %>
<%@page import="java.util.*,java.net.*,java.io.*,com.csc.upload.*"%>
<jsp:useBean id="PRU0393" class="com.csc.library.system.Task" scope="page"/>
<%
    PRU0393.setChannel(request,response);
    PRU0393.checkProfile();
    UProfile u=PRU0393.getUProfile();
	
    session.setAttribute("finish","false");    

    CheckNull chk=new CheckNull();
     InitialEnvironment en = new InitialEnvironment("GLOBAL");
    String uploadDir = en.getValue("RECRUIT_UPLOAD-dir");
    String fileDir = chk.chkNullString(request.getParameter("__uploadType"));
    String fieldName = chk.chkNullString(request.getParameter("__fieldName"));
    String fileName = chk.chkNullString(request.getParameter("__fileName"));
	String filePath = uploadDir +fileDir;

	FileDownloadUtils downloadutils = new FileDownloadUtils("RECRUIT_UPLOAD", "dir", "defaultperson.jpg", "PICTURE");
	String path = downloadutils.getViewURL();

%>

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<link href="../CSS/MENU.css" rel="stylesheet" type="text/css">
<script  language="JavaScript" src="../JS/SCREEN.js"></script>
<script src="../JS/VIEWCALENDAR.js"></script>
<script language='javascript'>setLang('<%=u.get("lang")%>');</script>
<script language="JavaScript" >

function closeUpload(){
    with(document.cscform){
        var fieldName = window.opener.document.cscform.<%=fieldName%>.value="";
        if(__uploadType.value.toLowerCase()== "picture"){
            window.opener.document.cscform.employeePic.src="<%=path %>";
	    }
	}
    window.close();
}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form  name="cscform" enctype="multipart/form-data"  method="POST">
  <input  type="hidden" name="__cmd"  value="">
  <input type="hidden" name="__screen" value="PRU0393">
  <input  type="hidden" name="__help" value="">
  <input type="hidden" name="__fixCon" value="">
  <input type="hidden" name="__companyid" value="<%=u.get("companyid")%>">
  <input type="hidden" name="__language" value ="<%=u.get("lang")%>">
  <input type="hidden" name="__uploadType" value="<%=fileDir%>">
  <br>
  <br>
  <br>
  <div align="center">
    <table  cellpadding="0" cellspacing="0">
      <tr >
        <td  class="header">PRU0393,&nbsp;<script language="javascript">swapLang("File Deletion Page");</script>&nbsp;</td>
      </tr>
      <tr >
        <td  colspan="2">
          <table width="630" border="0">
            <tr>
              <td width="556"><p>&nbsp;</p>
                <center>
                  DELETE FILE ..........<br>
                  Please wait...............
                </center>
                <p>&nbsp;</p></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td  class="bottom"></td>
      </tr>
    </table>
  </div>
</form>
<%
    if(fileName.length()>0){  
        try{
		    if(!fileName.equalsIgnoreCase("defaultperson.jpg")){
                File file = new File(filePath,fileName);
                file.delete();
			}
        }catch (Exception e){ }
            session.setAttribute("finish","true");
      }
    %>
<script language="javascript">closeUpload();</script>
</body>
</html>