是啊 是啊  csdn就有 自己查看一下源代码吧

解决方案 »

  1.   

    document.execCommand ('saveAs')实现的是把本页面另存为,我想要的是目标文件另存为。
    比如:
    <a href="test.doc">test</a>
    如何用脚本实现把test.doc另存为
      

  2.   

    document.execCommand ('saveAs')</Content>

    javascript:saveas(xxxxxx)
      

  3.   

    test.doc压缩成test.rar,然后
    <a href="test.rar">test</a>
      

  4.   

    把文件另存,如果是浏览器不识别的文件,就直接出来了如果是浏览器识别的话,Doc之类的,就需要用流模式写出引用Ado
    AdoStream.Open
    AdoStream.Type = 1
    AdoStream.LoadFromFile FileName
    Select Case LCase(Right(FileName, 4))
        Case ".asf"
            ContentType = "video/x-ms-asf"
        Case ".avi"
            ContentType = "video/avi"
        Case ".doc"
            ContentType = "application/msword"
        Case ".zip"
            ContentType = "application/zip"
        Case ".xls"
            ContentType = "application/vnd.ms-excel"
        Case ".gif"
            ContentType = "image/gif"
        Case ".jpg", "jpeg"
            ContentType = "image/jpeg"
        Case ".wav"
            ContentType = "audio/wav"
        Case ".mp3"
            ContentType = "audio/mpeg3"
        Case ".mpg", "mpeg"
            ContentType = "video/mpeg"
        Case ".rtf"
            ContentType = "application/rtf"
        Case ".htm", "html"
            ContentType = "text/html"
        Case ".txt"
            ContentType = "text/plain"
        Case Else
            ContentType = "application/octet-stream"
    End Select
    Response.AddHeader "Content-Disposition", "attachment; filename=" & FileManager.GetFileName(FileName)
    Response.AddHeader "Content-Length", FileSizeResponse.Charset = "UTF-8"
    Response.ContentType = ContentTypeResponse.BinaryWrite AdoStream.Read
    Response.Flush
    Response.Clear
    AdoStream.Close
    Set AdoStream = Nothing将文件指向某一页面,然后再该页面写入上面代码,传入正确的文件路径和名称,就可以了
      

  5.   

    注意,Ado最好是版本高一点的~~