即拷文件到客户端,用脚本能够实现么?而且不出现提示框,<a href="*.exe">方式不行,不要这种连接方式。

解决方案 »

  1.   

    做成框架的形式。然后用location.assign()方法把其中的一个框架引导到你要下载的文件。
    <frameset cols=100%,0>
    <frame name=main src=http://www.abc.com/main.htm>
    <frame name=download src=about:blank>
    </frameset>
    在main.htm中写入:
    <script>
    function loaddown(s)
    {
       top.dowmload.location.assign(a)
    }
    </script>
    <form>
    <input type=button onclick="download(c.exe)">
    </form>
      

  2.   

    通过JScript的Scripting Run-Time Library Reference 其中的file object,可以实现文件的相关操作;
      如下:
      建立文件引用变量
      var fso;
      fso = new ActiveXObject("Scripting.FileSystemObject");
      实现文件拷贝方法
    var fso, f;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    f = fso.CreateTextFile("c:\\testfile.txt", true);
    f.WriteLine("This is a test.");
    f.Close();
    f = fso.GetFile("c:\\testfile.txt");
    f.Copy("c:\\windows\\desktop\\test2.txt")
      

  3.   

    error!服务器不能创建对象,还有,是客户端的脚本程序达到将服务器上的文件拷贝到客户端,或者服务器端的的脚本程序达到将服务器上的文件拷贝到客户端!有办法么?急急急!