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"));
response.setHeader("Content-Disposition","attachment:filename=1.jsp");
response.setHeader("Content-Type", "csv/downloadable"); %>
<a href="1.jsp">aa</a>