@RequestMapping("upload")
public String upload(HttpServletRequest request, PrintWriter out) throws JSONException {
String realPath = "D:/upload"
+ DateUtil.getCurrenDate()// 上传图片路径dir
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request
Map<String, MultipartFile>fileMap = multipartRequest.getFileMap()
MultipartFile multipartFile = null
String fileName = null
for (Map.Entry<String, MultipartFile>set : fileMap.entrySet()) {
// String filekey = set.getKey()// Filedata
multipartFile = set.getValue()// 文件名
}
fileName = this.storeIOc(multipartRequest, multipartFile,realPath)
String fileName = ""
String logImageName = ""
if (file.isEmpty()) {
System.out.println("文件未上传")
} else {
FileHelper.mkdirs(realPath)//如果文件路径不存在,则创建
String _fileName = file.getOriginalFilename()
String suffix = _fileName.substring(_fileName.lastIndexOf("."))
// /**使用UUID生成文件名称**/
logImageName = UUID.randomUUID().toString() + suffix
fileName = realPath + File.separator + logImageName
File restore = new File(fileName)
try {
file.transferTo(restore)
} catch (Exception e) {
throw new RuntimeException(e)
}
}
// 返回默认的图片地址
return fileName
}
win7不建议使用IE9(2011.3.),win7和office2010(2009.11)出现时间更靠近IE8(2009.3),IE9要sp1以上才支持,它和win7 sp1同时出现。我的笔记本电脑2010年4月买的,原装win7旗舰版的office2010。如果系统要稳定,几个微软产品应该配:xp+office2003+IE6,vista+office2007+IE7,win7+office2010+IE8,win8+office2013+IE10,win8.1+office2013+IE11,win10+office2016+microsoft edge欢迎分享,转载请注明来源:内存溢出
评论列表(0条)