|
|
|
@ -164,16 +164,15 @@ public class GlobalController implements ErrorController {
|
|
|
|
|
|
|
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
|
|
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
|
|
|
|
headers.setContentDispositionFormData("attachment", new String(downFile.getName().getBytes("UTF-8"), "iso-8859-1"));
|
|
|
|
|
|
|
|
|
|
//========
|
|
|
|
|
//下载DEMO
|
|
|
|
|
//========
|
|
|
|
|
if (file == null) {
|
|
|
|
|
file = "test.txt";
|
|
|
|
|
headers.setContentDispositionFormData("attachment", file);
|
|
|
|
|
headers.setContentDispositionFormData("attachment", new String(file.getBytes("UTF-8"), "iso-8859-1"));
|
|
|
|
|
return new ResponseEntity<byte[]>("test".getBytes(),
|
|
|
|
|
headers, HttpStatus.CREATED);
|
|
|
|
|
headers, HttpStatus.CREATED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(new File(file)),
|
|
|
|
|