工具类:
public static void saveFile(MultipartFile file,HttpServletRequest request,String name) throws IOException{
String path=upload_img_path;
System.out.println("path:"+path);
File folder = new File(path);
if(!folder.exists()){
folder.mkdirs();
}
byte[] bytes = file.getBytes();
BufferedOutputStream stream =new BufferedOutputStream(new FileOutputStream(new File(path+"/"+name)));
stream.write(bytes);
stream.close();
}
读取流显示图片
@RequestMapping("/image")
@ResponseBody
public void getImage(HttpServletRequest request, HttpServletResponse response) throws Exception{
String JPG="image/jpeg;charset=GB2312";
String iname=request.getParameter("in