<A href="filepath"></a>这样不能左键下载么?

解决方案 »

  1.   

    <A href="filepath"></a>这样不能左键下载么?
    点保存不好了
      

  2.   

    比如那个文件是一Falsh文件,它就会直接在IE里打开
      

  3.   

    用一个页面专门返回下载的文件~~~把文件地址传过去~~设置http响应头让浏览器识别为文件下载,返回文件~~
      

  4.   

    我只会用ASP作这个功能
    http://tzzhengda.com/119/dw/fifde.htm
    这个网站上就是楼主说的功能,楼主看一下吧。所它的代码下来。自己看一下
      

  5.   

    看看这个 http://www.haolla.com/girls/index.asp
             http://haolla.com/wy
      

  6.   

    onclick="document.execCommand('saveas','true','linkname')"
      

  7.   

    楼主解决了,说下如何做的啊。我也想知道怎么做。我以前用.net做的,不过要用C#代码才行。有点麻烦。还要后台安装.netframework才可以。
      

  8.   

    <A href="download.html">download</a>
    ============
    在download.html里实现下载。
      

  9.   

    回复人:ishion(爱森) ( 四级(中级)) 信誉:100  2007-3-10 16:54:46  得分:0
    onclick="document.execCommand('saveas','true','linkname')"这个就是可以的,当然也可以换个写法:
    <a href="javascript:document.execCommand('saveas','true','linkname');">download</a>这个应当只适应于IE,在FF下需要另一个方法,另外如何要保存HTML全部内容,需要引用ActiveX控 件,网上有可以查一下
      

  10.   

    给个php的js
    href="downfile.php?path=xxx"
    ===============
    downfile.php
    <?
    Header("Content-type: application/octet-stream");
    Header("Accept-Ranges: bytes");
    $filesize=0;
    if(file_exists($qm["path"]))
    $filesize=filesize($qm["path"]);
    Header("Content-Length: ".$filesize);
    Header("Content-Disposition: attachment; filename=".basename($qm["path"]));
    readfile($qm["path"]);
    exit;
    ?>