我的Servlet
private static final String SAVE_DIR = "videoFiles";
Part vidFilePart = request.getPart("vidinput");
String vidFileName = request.getParameter("vidfilename");
String appPath = request.getServletContext().getRealPath("");
// constructs path of the directory to save uploaded file
String savePath = appPath + File.separator + SAVE_DIR;
File fileSaveDir = new File(savePath);
if (!fileSaveDir.exists()) {
fileSaveDir.mkdir();
}
for (Part part : request.getParts()) {
part.write(savePath + File.separator + vidFileName);
}
session.setAttribute("vidsessmessage", "Video Has Been Uploaded Successfully");
response.sendRedirect("videos.jsp");
一切正常我被重定向到响应并且videoFiles中有一个视频文件但是当试图上传一个12 MB的文件时,结果文件只有12个字节。这里有什么问题?