package servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/home/student-upload-finished-product")
@MultipartConfig
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 = request.getParameter("id");
        String fileURL;
        try {
            fileURL = servlet.Utils.saveFile(request, fileType);
        }catch (Exception e)
        {
            System.out.print(e);
            response.sendRedirect("/op_fail.jsp");
        }
    }
}
