| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <%@page import="java.net.URLDecoder"%>
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <%@page import="com.uas.cr.util.FileUtil" %>
- <%@page import="java.util.Enumeration" %>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>报表上传</title>
- <link rel="shortcut icon" type="image/x-icon" href="img/u.png" />
- <script type="text/javascript" src="jquery/jquery.min.js"></script>
- <style type="text/css">
- .button {
- display: inline-block;
- outline: none;
- cursor: pointer;
- text-align: center;
- text-decoration: none;
- font: 14px/100% Arial, Helvetica, sans-serif;
- padding: .5em 2em .55em;
- text-shadow: 0 1px 1px rgba(0,0,0,.3);
- -webkit-border-radius: .5em;
- -moz-border-radius: .5em;
- border-radius: .5em;
- -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
- -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
- box-shadow: 0 1px 2px rgba(0,0,0,.2);
- }
- .button:hover {
- text-decoration: none;
- }
- .button:active {
- position: relative;
- top: 1px;
- }
- .white {
- color: #606060;
- border: solid 1px #b7b7b7;
- background: #fff;
- background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
- background: -moz-linear-gradient(top, #fff, #ededed);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
- }
- .white:hover {
- background: #ededed;
- background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
- background: -moz-linear-gradient(top, #fff, #dcdcdc);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
- }
- .white:active {
- color: #999;
- background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
- background: -moz-linear-gradient(top, #ededed, #fff);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
- }
- .medium {
- font-size: 12px;
- }
-
- .div1{
- float: left;
- height: 41px;
- background: #f5696c;
- width: 144px;
- position:relative;
- }
- .div2{
- text-align:center;
- padding-top:12px;
- font-size:15px;
- font-weight:800
- }
- .inputstyle{
- width: 144px;
- height: 41px;
- cursor: pointer;
- font-size: 30px;
- outline: medium none;
- position: absolute;
- filter:alpha(opacity=0);
- -moz-opacity:0;
- opacity:0;
- left:0px;
- top: 0px;
- font-size
- }
- .fileinput {
- }
- .fileinput:HOVER {
- border-color: #0BECEC;
- }
- .fileinput:FOCUS {
- border-color: #0BECEC;
- }
-
- .container {
- margin: 10px;
- padding: 10px;
- }
-
- .inputStyle {
- border-radius : 4px;
- line-height: 1.6;
- box-shadow: none;
- width: 200px;
- font-size: 14px;
- }
- label {
- font:宋体;
- }
- h3 {
- margin-bottom: 5px;
- margin-top: 5px;
- }
- }
- </style>
- </head>
- <body class="container">
- <%
- String enuu = URLDecoder.decode(request.getParameter("enuu"), "UTF-8");
- String reportName = URLDecoder.decode(request.getParameter("reportName"), "UTF-8");
- String fileName = URLDecoder.decode(request.getParameter("fileName"), "UTF-8");
- String title = URLDecoder.decode(URLDecoder.decode(URLDecoder.decode(request.getParameter("title"), "UTF-8"), "UTF-8"),"UTF-8");
- String name = URLDecoder.decode(request.getParameter("userName"), "UTF-8");
- %>
- <head><h3>上传文件</h3></head>
- <hr>
- <form action="do_upload.jsp" method="post" enctype="multipart/form-data" onsubmit = "beforUp()" >
- <br>
- <label style="word-spacing : 17px;">企 业 UU:</label>
- <input type="text" class="inputStyle" name="uu" value="<%=enuu %>" required="required"/> <br><br>
- <label style="word-spacing : 3px;">报 表 业 务:</label>
- <input type="text" class="inputStyle" name="reportBusi" value="<%=reportName%>" required="required"/> <br><br>
- <label style="word-spacing : 3px;">报 表 描 述:</label>
- <input type="text" class="inputStyle" name="description" value="<%=title%>" required="required"/><br><br>
- <label>报表页面名称:</label>
- <input type="text" class="inputStyle" name="reportPageName" placeholder="make、purchase等类型" required="required"/><br><br>
- <input type="hidden" name="userName" value="<%=name %>">
- <div class="fileinput">
- <input type="file" name="fileforload" accept=".rpt" style="font-size: 15px;"/>
- </div>
- <hr style="margin-top: 15px;">
- <input type="submit" value="commit" name="submit" class="button white" style="float: right; margin-top: 5px;">
- </form>
- </body>
- <script type="text/javascript">
- var beforUp = function() {
- var enuu = document.getElementsByName("uu")[0].value;
- var file = document.getElementsByName("fileforload")[0].value;
- if(!file) {
- alert("请选择需要上传的文件! ");
- window.event.returnValue=false;
- return ;
- }
- var files = file.split("/");
- file = files[files.length-1];
- $.ajax({
- url: "upFileIsExist",
- data: {"enuu": enuu, "file":file},
- async:false,
- success: function(result, status, xhr) {
- var str = result;
- if(str == "yes") {
- var choose = confirm("文件已经存在,确定要覆盖? ");
- if(!choose) {
- window.event.returnValue=false;
- }
- }
- },
- error: function(result, status, xhr) {
- var str = result.responseText;
- alert(str);
- }
- });
- }
- </script>
- </html>
|