//从前台通过name值获取file MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest)request; MultipartFile multipartFile = multipartRequest.getFile("file"); //multipartFile转换成file CommonsMultipartFile cf= (CommonsMultipartFile)multipartFile; DiskFileItem fi = (DiskFileItem)cf.getFileItem(); File f = fi.getStoreLocation();
时间: 2024-12-21 20:17:37