首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

怎么弹出保存浏览对话框~

2012-02-01 
如何弹出保存浏览对话框~???在页面当中如何能够弹出保存浏览对话框,用js、vbs或其它任何可以做到的话,希望

如何弹出保存浏览对话框~???
在页面当中如何能够弹出保存浏览对话框,用js、vbs或其它任何可以做到的话,希望能给个提示~

问题解决马上结贴

[解决办法]
你的意思是保存成功以后出个提示?

<%if(request.getAttribute( "msg ")!=null)
{%>
<script>
alert( ' <%=request.getAttribute( "msg ")%> ');
</script>
<%
}
%>
放在jsp页面最后,request.setAttribute( "msg ", "保存成功提示 ")
你要是用taglib的话,也可以把显示逻辑用logic标签控制
[解决办法]
response.header( "Content-Disposition ", "attachment;filename= "+filename);
[解决办法]
File downloadFile;
response.setContentType( "application/csv ");
response.setHeader( "Content-disposition ",
"attachment; filename=\ " " + downloadFile.getName() +
"\ " ");
BufferedInputStream bufInStream = new BufferedInputStream(new
FileInputStream(downloadFile));
BufferedOutputStream bufOutStream = new BufferedOutputStream(response.
getOutputStream());
int readLine = 0;
readLine = bufInStream.read();
while (readLine != -1) {
bufOutStream.write(readLine);
readLine = bufInStream.read();
}
bufOutStream.close();
bufInStream.close();
downloadFile = null;
[解决办法]
不知道你说的意思啊
[解决办法]
不知道这是不是你要的效果:

<input type= "file " name= "uploadFile " />
[解决办法]
不需要的啦,你写好下载的东西后,
response.setContentType( "application/csv ");
response.setHeader( "Content-disposition ",
"attachment; filename=\ " " + downloadFile.getName() +
"\ " ");

具体的我明天到公司了帮你看看,它会自动弹出来的啊

热点排行