直接用 stream 流将文件输出到客户端。

解决方案 »

  1.   

    用服务器端语言
    response.setContentType("application/octet-stream; charset=iso-8859-1");
    response.addHeader("Content-disposition", "attachment; filename=\" 文件名字.xls\"");
      

  2.   

    IE对于不能识别的文件将会弹出"存为"对话框. 难到没有什么简单的方法么? 我想实现一个链接, 也许能用"onclick"事件迫使IE弹出"存为"对话框. 
    (强调一下, 我这里没有其他SERVER环境,如Servlet)
    高人出手!
      

  3.   

    需要这样保存吗??
    <input type=button value=保存     onclick="document.execCommand('SaveAs')">
    <input type=button value=另存为   onclick="document.execCommand('Saveas',false,'c:\\test.htm')">