Upload New File

parent b151cdce
<%@page import="javax.servlet.*, javax.servlet.http.*, java.io.*, ibase.utility.CommonConstants, org.apache.commons.lang.StringEscapeUtils"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>VisionEDI Log</title>
<style>
input[type="button"] {
margin: 0px 0px 0px 1100px;
font-size: 15px;
text-align: bottom;
display: inline-block;
border-radius: 4px;
}
h2 {
font-size: 20px;
text-align: bottom;
display: inline-block;
margin: 0px 0px 0px 0px;
}
</style>
</head>
<body style="font-family: calibri; margin: 0; padding: 0; overflow: hidden;">
<%
String fileName = request.getParameter("FileName");
String sep = File.separator;
File file = new File(CommonConstants.JBOSSHOME + sep + "upload_failed" + sep + fileName);
String filePath = file.getAbsolutePath();
%>
<div style="overflow: hidden;">
<div style="display: flex; align-items: center; height: 50px; padding: 0 16px;">
<form style="margin: 0; padding: 0; display: flex; width: 100%; align-items: center; position: relative;">
<div style="font-size: 1.5em; font-weight: 600; text-align: left; min-height: 50px; display: flex; align-items: center; width: calc(100% - 100px); white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">
File Name : <%= fileName %>
</div>
<input type="button" value="Return" onclick="history.back()" size="40"
style="border-style: none; margin: 0; font-size: 12px; border-radius: 4px; box-shadow: 1px 1px 5px 2px rgba(0, 0, 0, .2); height: 30px; padding: 0 12px; background-color: #4286f5; color: #fff; letter-spacing: 1px; font-weight: 600; text-transform: uppercase; position: absolute; right: 0;">
<!-- Download button using anchor tag -->
<a href="<%= filePath %>" download>
<button style="background-color: #4286f5; color: #fff; border: none; padding: 10px; border-radius: 4px; cursor: pointer; margin-right: 10px;">Download Log</button>
</a>
</form>
</div>
<div style="padding: 16px; height: calc(100% - 98px); overflow: auto; box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, .2); margin: 0 16px 16px 16px; border-radius: 3px;">
<% if (file.exists()) {
BufferedReader br = new BufferedReader(new FileReader(file));
String fileContents = "";
while ((fileContents = br.readLine()) != null) {
out.println(StringEscapeUtils.escapeXml(fileContents.toString()) + "<br>");
}
%>
<% } else { %>
<%= fileName + " file not found" %>
<% } %>
</div>
</div>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment