<input type=button onclick="document.execCommand('SaveAs');">

解决方案 »

  1.   

    需要提醒的是 我希望能够在客户端点饥这个button 网页可以自动存在服务器上的某个目录下,而网页可能包括各种网页元素,我的程序使用java.
      

  2.   

    用Applet
    先下载
    public void ReadURL(String strURL)
    {
    try
    {
    int iHttpResult;
    URL m_URL=new URL(strURL);
    URLConnection m_URLConn=m_URL.openConnection();
    m_URLConn.connect();
    HttpURLConnection m_HttpConn=(HttpURLConnection)m_URLConn;
    iHttpResult=m_HttpConn.getResponseCode();
    if(iHttpResult!=HttpURLConnection.HTTP_OK)
    JOptionPane.showMessageDialog(this,"无法连接...");
    else
    {
    int iFileSize=m_URLConn.getContentLength();
    InputStreamReader m_Reader=new InputStreamReader(m_URLConn.getInputStream());
    char[] Buffer=new char[2048];
    int iNum=0;
    while(iNum>-1)
    {
    iNum=m_Reader.read(Buffer);
    if(iNum<0)break;
    //JOptionPane.showMessageDialog(this,new String(Buffer,0,iNum));
    }
    m_Reader.close();
    }
    }
    catch(Exception e)
    {
    JOptionPane.showMessageDialog(this,e.getMessage());
    }
    }
    再上传[跟下载一样了].服务器用JSP或者Servlet来接收
      

  3.   

    ASP:可以看看这文章
    http://www.csdn.net/develop/read_article.asp?id=22086