是简单的<a href="filePath" target="_blank">文件下载</a>
还是用PHP实现?麻烦说一下呵呵

解决方案 »

  1.   

    有人跟你问了同样的问题
    参考http://topic.csdn.net/t/20000914/08/29859.html
      

  2.   

    第一:
    <a href="aaa.txt">下载</a>方式2:
    <?php
    $filename = "theDownloadedFileIsCalledThis.mp3";
    $myFile = "/absolute/path/to/my/file.mp3";$mm_type="application/octet-stream";header("Cache-Control: public, must-revalidate");
    header("Pragma: hack"); // WTF? oh well, it works...
    header("Content-Type: " . $mm_type);
    header("Content-Length: " .(string)(filesize($myFile)) );
    header('Content-Disposition: attachment; filename="'.$filename.'"');
    header("Content-Transfer-Encoding: binary\n");readfile($myFile);?>