当前位置: 技术问答>java相关
请教,简单问题
来源: 互联网 发布时间:2015-01-09
本文导语: 紧急求救:请问在IE中点一文件名,然后下载对话框自动弹出的效果是怎么做到的 | response.setHeader("Content-Disposition", "attachment; filename=" + yourFileName); response.setHeader("Connection", "close"); response.se...
紧急求救:请问在IE中点一文件名,然后下载对话框自动弹出的效果是怎么做到的
|
response.setHeader("Content-Disposition", "attachment; filename=" + yourFileName);
response.setHeader("Connection", "close");
response.setHeader("Content-Type", "application/octet-stream");
response.setContentLength(yourFileSize);
然后就可以用out.write()直接将内容写入到指定文件中,如
out.write(new String(byteBuffer,0,iBufferLength,"ISO-8859-1"));
response.setHeader("Connection", "close");
response.setHeader("Content-Type", "application/octet-stream");
response.setContentLength(yourFileSize);
然后就可以用out.write()直接将内容写入到指定文件中,如
out.write(new String(byteBuffer,0,iBufferLength,"ISO-8859-1"));
|
1.jsp:
aa
aa