国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
response.setCharacterEncoding(request.getCharacterEncoding()); | |
response.setContentType(MediaType.APPLICATION_OCTET_STREAM.toString()); | |
String realFileName = URLEncoder.encode(realFileName, StandardCharsets.UTF_8.toString()); | |
// 解决中文文件名乱码关键行 | |
response.setHeader("Content-Disposition", "attachment; filename=\"" + realFileName + "\"; filename*=utf-8''" + realFileName); | |
Path path = Paths.get(filePath+filename); | |
Files.copy(path, response.getOutputStream()); | |
response.flushBuffer(); |