使用oreilly的MultipartRequest上传文件
随便写个上传的表单(enctype="multipart/form-data"),servlet这么写~
-
-
protected void doPost(HttpServletRequest request, HttpServletResponse response)
-
-
int maxPostSize = 5 * 1024 * 1024 ;
-
-
MultipartRequest multi = new MultipartRequest(request, getServletContext().getRealPath("/")+ path ,maxPostSize,"GBK");
-
-
response.sendRedirect("index.jsp");
-
}
即可 - -
- 无匹配