提交 6ae1b963 authored 作者: 许俊's avatar 许俊

修改

上级 d0a27522
...@@ -22,7 +22,7 @@ public class FileUtil { ...@@ -22,7 +22,7 @@ public class FileUtil {
try { try {
path = new File(ResourceUtils.getURL("classpath:").getPath()); path = new File(ResourceUtils.getURL("classpath:").getPath());
os = response.getOutputStream(); os = response.getOutputStream();
bis = new BufferedInputStream(response.getClass().getClassLoader().getResourceAsStream("res/test.apk")); bis = new BufferedInputStream(response.getClass().getClassLoader().getResourceAsStream("res/cc.apk"));
int i = bis.read(buff); int i = bis.read(buff);
while (i != -1) { while (i != -1) {
os.write(buff, 0, buff.length); os.write(buff, 0, buff.length);
......
...@@ -85,7 +85,7 @@ public class DownLoadController { ...@@ -85,7 +85,7 @@ public class DownLoadController {
@RequestMapping("/download3") @RequestMapping("/download3")
@ResponseBody @ResponseBody
public void Download(HttpServletResponse response) { public void Download(HttpServletResponse response) {
String fileName = "test.apk"; String fileName = "cc.apk";
String result = FileUtil.downloadFile(response, fileName); String result = FileUtil.downloadFile(response, fileName);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论