diff --git a/src/servlet/S_StudentUploadFinishedProduct.java b/src/servlet/S_StudentUploadFinishedProduct.java index 9bd9e40..b7271e4 100644 --- a/src/servlet/S_StudentUploadFinishedProduct.java +++ b/src/servlet/S_StudentUploadFinishedProduct.java @@ -14,9 +14,16 @@ public class S_StudentUploadFinishedProduct extends HttpServlet { static String fileType = "graduation_design_finished_product"; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = "000"; - //String id = request.getParameter("id"); - System.out.println("id finished"); - String fileURL = servlet.Utils.saveFile(request, fileType); - System.out.println("finished"); + //String files = request.getParameter("file"); + System.out.print("123"); + System.out.print( request.getPart("file")); + System.out.print("123"); + try { + String fileURL = servlet.Utils.saveFile(request, fileType); + }catch (Exception e) + { + System.out.print(e); + } + System.out.print("222"); } } diff --git a/web/home/home.jsp b/web/home/home.jsp index a04371b..11b685a 100644 --- a/web/home/home.jsp +++ b/web/home/home.jsp @@ -1,5 +1,8 @@ <%@ 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. User: lenovo Date: 2019/1/9 @@ -28,13 +31,14 @@ -<%String type="teacher";pageContext.setAttribute("userType",type);%> -<%List list=new ArrayList<>(); - list.add("001"); - list.add("002"); +<% + User user=(User)session.getAttribute("user"); + String type=user.getType(); + pageContext.setAttribute("userType",type); + Condition condition=user.getCondition(); + //List pList=condition.getProcesses(); + int length=0; int index=0; - pageContext.setAttribute("list",list); - session.setAttribute("list",list); %>
diff --git a/web/home/upload_file.jsp b/web/home/upload_file.jsp index 45cf850..ee25ffb 100644 --- a/web/home/upload_file.jsp +++ b/web/home/upload_file.jsp @@ -23,9 +23,11 @@
-
+
+
选择文件
-
上传文件
+
上传文件
+
diff --git a/web/jsFile/upload_action.js b/web/jsFile/upload_action.js index 906fe1c..866ac3a 100644 --- a/web/jsFile/upload_action.js +++ b/web/jsFile/upload_action.js @@ -5,18 +5,19 @@ $(document).ready(function () { }) function sendFile() { var fileData =new FormData(); - var Url4='testfrom.jsp'; - var file=$('.true-select').files; + var Url4='student-upload-finished-product'; + var file=$('#select')[0].files[0]; if($('.true-select').val()=='') { alert("请选择文件"); return; } + alert(file); fileData.append("file",file); $.ajax({ type:"post", url:Url4, - date:fileData, + data:fileData, processData:false, contentType:false, success:function (data,status) {