java大神给我解释一下下面几句话的意思吧response.setHeader("Content-Disposition","attachment; filename=" + Name);response.setContentType("application/octet-stream; charset=utf-8");os.write(FileUtils.readFileToByteArray(downFile.getFile
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 18:24:10
java大神给我解释一下下面几句话的意思吧response.setHeader("Content-Disposition","attachment; filename=" + Name);response.setContentType("application/octet-stream; charset=utf-8");os.write(FileUtils.readFileToByteArray(downFile.getFile
java大神给我解释一下下面几句话的意思吧
response.setHeader("Content-Disposition",
"attachment; filename=" + Name);
response.setContentType("application/octet-stream; charset=utf-8");
os.write(FileUtils.readFileToByteArray(downFile.getFile()));
os.flush();
java大神给我解释一下下面几句话的意思吧response.setHeader("Content-Disposition","attachment; filename=" + Name);response.setContentType("application/octet-stream; charset=utf-8");os.write(FileUtils.readFileToByteArray(downFile.getFile
第一第二句是设置文件头,告诉对方浏览器,我这里是个流文件,文件名是 Name.
第三句,是将downFile.getFile()的文件装换成流的形式向对方浏览器输出.
第四句,由于系统有时会将文件缓冲,造成流输出的延误,用flush强制流立刻输出.