Commit 8341a4adde5d7eb0c03266d7b34b867dce592ece

Authored by 廖磊
1 parent fb0cf9d4

2

src/main/java/com/bsth/controller/DownloadController.java
... ... @@ -37,8 +37,8 @@ public class DownloadController
37 37 File file=new File(moudelPath);
38 38 HttpHeaders headers = new HttpHeaders();
39 39 String realFileName=new String(fileName.getBytes("UTF-8"),"iso-8859-1");//为了解决中文名称乱码问题
40   - headers.setContentDispositionFormData("attachment", URLDecoder.decode(realFileName,"utf-8"));
41   - System.out.println(realFileName);
  40 + headers.setContentDispositionFormData("attachment", fileName);
  41 + System.out.println( URLDecoder.decode(realFileName,"utf-8"));
42 42 headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
43 43 return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),
44 44 headers, HttpStatus.CREATED);
... ...