我的页面中有三个按钮,每个按钮是用
                  header("Cache-Control:private");
header("Content-Type: application/octet-stream");
header("Accept-Ranges: bytes"); header("Accept-Length:" . $filesize); header("Content-Disposition: attachment;filename=download.txt");
header("Pragma: no-cache");
header("Expires: 0");但是当我点第一按钮保存完文件,在点下一个按钮,页面有错。

解决方案 »

  1.   

    header("Content-Type:text/plain");
                              header("Accept-Ranges:bytes");
                              header("Accept-Length:".filesize($filename));
                              header("Content-Disposition: attachment;filename=".basename($filename));
      

  2.   

    我的页面中有三个按钮,每个按钮都是实现download file,按钮名字分别是a,b,c,我用的代码是下面的:
                      header("Cache-Control:private");
    header("Content-Type: application/octet-stream");
    header("Accept-Ranges: bytes");
    header("Accept-Length:" . $filesize);
    header("Content-Disposition: attachment;filename=download.txt");
    header("Pragma: no-cache");
    header("Expires: 0");但是当我点a按钮download完文件,在点b按钮,页面有错,不能download文件。
      

  3.   

    把HTML也放过来看下啊
    为什么要做三个按钮?
      

  4.   

    <input type=button name=down id=down value='a' onClick='a();'>
    <input type=button name=down id=down value='b' onClick='b();'>
    <input type=button name=down id=down value='c' onClick='c();'>
    function a()
    {
      document.form.Comfirm.value = 1;
      document.form.submit();
     }