Merge remote-tracking branch 'remotes/origin/hechu1'

# Conflicts:
#	src/core/process/C_TeacherSearchStudent.java
#	web/jsFile/upload_action.js
hechu1
zhai_lw 6 years ago
commit 4e8235598f

@ -14,9 +14,16 @@ public class S_StudentUploadFinishedProduct extends HttpServlet {
static String fileType = "graduation_design_finished_product"; static String fileType = "graduation_design_finished_product";
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = "000"; String id = "000";
//String id = request.getParameter("id"); //String files = request.getParameter("file");
System.out.println("id finished"); System.out.print("123");
String fileURL = servlet.Utils.saveFile(request, fileType); System.out.print( request.getPart("file"));
System.out.println("finished"); System.out.print("123");
try {
String fileURL = servlet.Utils.saveFile(request, fileType);
}catch (Exception e)
{
System.out.print(e);
}
System.out.print("222");
} }
} }

@ -1,5 +1,8 @@
<%@ page import="java.util.List" %> <%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%-- <%@ page import="java.util.ArrayList" %>
<%@ page import="core.user.User" %>
<%@ page import="core.process.Condition" %>
<%@ page import="core.process.Process" %><%--
Created by IntelliJ IDEA. Created by IntelliJ IDEA.
User: lenovo User: lenovo
Date: 2019/1/9 Date: 2019/1/9
@ -28,13 +31,14 @@
<script type="text/javascript" src="../jsFile/sub-msg-input.js"></script> <script type="text/javascript" src="../jsFile/sub-msg-input.js"></script>
</head> </head>
<body> <body>
<%String type="teacher";pageContext.setAttribute("userType",type);%> <%
<%List<String> list=new ArrayList<>(); User user=(User)session.getAttribute("user");
list.add("001"); String type=user.getType();
list.add("002"); pageContext.setAttribute("userType",type);
Condition condition=user.getCondition();
//List<Process> pList=condition.getProcesses();
int length=0;
int index=0; int index=0;
pageContext.setAttribute("list",list);
session.setAttribute("list",list);
%> %>
<div class="main"> <div class="main">
<div class="top-bar"> <div class="top-bar">

@ -23,9 +23,11 @@
<span class="file-name" style="color: rgba(0,0,0,0.72)"> <span class="file-name" style="color: rgba(0,0,0,0.72)">
</span> </span>
</div> </div>
<div class="file-input-frame"><input class="true-select" type="file" accept="application/pdf" multiple="multiple"> <div class="file-input-frame">
<input class="true-select" id="select" type="file" accept="application/pdf" multiple="multiple">
<div class="upload-button select-file">选择文件</div> <div class="upload-button select-file">选择文件</div>
<div class="upload-button upload-it">上传文件</div></div> <div class="upload-button upload-it">上传文件</div>
</div>
</div> </div>
</div> </div>
</body> </body>

@ -5,18 +5,19 @@ $(document).ready(function () {
}) })
function sendFile() { function sendFile() {
var fileData =new FormData(); var fileData =new FormData();
var Url4='testfrom.jsp'; var Url4='student-upload-finished-product';
var file=$('.true-select').files; var file=$('#select')[0].files[0];
if($('.true-select').val()=='') if($('.true-select').val()=='')
{ {
alert("请选择文件"); alert("请选择文件");
return; return;
} }
alert(file);
fileData.append("file",file); fileData.append("file",file);
$.ajax({ $.ajax({
type:"post", type:"post",
url:Url4, url:Url4,
date:fileData, data:fileData,
processData:false, processData:false,
contentType:false, contentType:false,
success:function (data,status) { success:function (data,status) {

Loading…
Cancel
Save