Initial commit: WACE PLM with database initialization features
- Add Docker Compose configurations for dev, prod, and standalone environments - Add database initialization scripts (init-db.sh, init-db-docker.sh) - Add enhanced start-docker-linux.sh with DB init support - Add comprehensive database initialization guide - Support for automatic dbexport.pgsql import on first run - Include safety checks for production environment
This commit is contained in:
74
WebContent/WEB-INF/view/common/download.jsp
Normal file
74
WebContent/WEB-INF/view/common/download.jsp
Normal file
@@ -0,0 +1,74 @@
|
||||
<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%>
|
||||
<%@ page import="java.util.*, java.io.*" %>
|
||||
<%@include file= "/init.jsp" %>
|
||||
<%
|
||||
|
||||
HashMap map = (HashMap)request.getAttribute("FILE_MAP");
|
||||
if(map == null) map = new HashMap();
|
||||
|
||||
String objId = CommonUtils.checkNull(map.get("OBJID"));
|
||||
String targetObjId = CommonUtils.checkNull(map.get("TARGET_OBJID"));
|
||||
String savedFileName = CommonUtils.checkNull(map.get("SAVED_FILE_NAME"));
|
||||
String realFileName = CommonUtils.checkNull(map.get("REAL_FILE_NAME"));
|
||||
String docType = CommonUtils.checkNull(map.get("DOC_TYPE"));
|
||||
String docTypeName = CommonUtils.checkNull(map.get("DOC_TYPE_NAME"));
|
||||
String fileSize = CommonUtils.checkNull(map.get("FILE_SIZE"));
|
||||
String fileExt = CommonUtils.checkNull(map.get("FILE_EXT"));
|
||||
String filePath = CommonUtils.checkNull(map.get("FILE_PATH"));
|
||||
|
||||
if(!"".equals(realFileName)){
|
||||
realFileName = (java.net.URLEncoder.encode(realFileName, "UTF-8")).replaceAll("\\+", " ");
|
||||
}
|
||||
|
||||
String fullFilePath = filePath+"\\"+savedFileName;
|
||||
System.out.println("fullFilePath : "+fullFilePath);
|
||||
|
||||
File f = new File(fullFilePath);
|
||||
if(f.exists()){
|
||||
|
||||
int filesize = (int)f.length();
|
||||
byte buff[] = new byte[2048];
|
||||
int bytesRead;
|
||||
|
||||
try {
|
||||
out.clear();
|
||||
out=pageContext.pushBody();
|
||||
|
||||
//response.setContentType("text/plain; charset=EUC_KR");
|
||||
//response.setContentType("application/x-msdownload");
|
||||
response.setContentType("application/octet-stream;charset=euc-kr");
|
||||
response.setHeader("Content-Disposition", "attachment; filename="+ realFileName);
|
||||
FileInputStream fin = new java.io.FileInputStream(f);
|
||||
BufferedInputStream bis = new BufferedInputStream(fin);
|
||||
ServletOutputStream fout = response.getOutputStream();
|
||||
BufferedOutputStream bos = new BufferedOutputStream(fout);
|
||||
|
||||
while((bytesRead = bis.read(buff)) != -1) {
|
||||
bos.write(buff, 0, bytesRead);
|
||||
}
|
||||
bos.flush();
|
||||
|
||||
fin.close();
|
||||
fout.close();
|
||||
bis.close();
|
||||
bos.close();
|
||||
|
||||
//file download log 2015-12-22 jmpark start
|
||||
Map paramMap = new HashMap();
|
||||
paramMap.put("savedFileName", savedFileName);
|
||||
paramMap.put("realFileName", realFileName);
|
||||
paramMap.put("fileExt", fileExt);
|
||||
|
||||
//file download log 2015-12-22 jmpark end
|
||||
|
||||
} catch( IOException e){
|
||||
response.setContentType("text/html; charset=EUC_KR");
|
||||
out.println("Error : "+e.getMessage());
|
||||
}
|
||||
}else{
|
||||
response.setContentType("text/html; charset=EUC_KR");
|
||||
out.println("File Not Found : " + fullFilePath);
|
||||
}
|
||||
|
||||
|
||||
%>
|
||||
Reference in New Issue
Block a user