?????Spring Boot?????????,??????????????????????????????:
- ??
Content-Disposition
???????????????????URL??,????HttpHeaders
??Content-Disposition
???
String encodedFileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", " "); headers.add("Content-Disposition", "attachment; filename=\"" + encodedFileName + "\"");
- ??
Content-Type
???application/octet-stream
,?????????UTF-8
?
headers.add("Content-Type", "application/octet-stream; charset=UTF-8");
- ???????????????,??????????????
InputStream inputStream = new FileInputStream(file); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
??????,???????????????????,?????????