可以实现的,用header,不过我不记得代码了,回头再给你

解决方案 »

  1.   

    先根据id得以$filename
    // 输入文件标签
    Header("Content-type: application/octet-stream");
    Header("Accept-Ranges: bytes");
    Header("Accept-Length: ".filesize($filename));
    Header("Content-Disposition: attachment; filename=$filename");
    // 输出文件内容
    $fp = fopen($filename, "rb");
    echo fread($fp,filesize($filename));
    fclose($fp);
    exit();
      

  2.   

    <?
    可以试一下以下代码,IE 和NetScape下均可
    次数可以用另数一变量保存到据库或文件中
    $name=trim(basename($strFullPath));
    header("Expires: " . gmdate("D, d M Y H:i:s",time()+24*3600) . " GMT");
    header("Cache-Control:");
    header("Pragma: cache");
    header("Connection: close"); if(strpos(getenv("HTTP_USER_AGENT") , "MSIE")){
    header("Content-type: application/download");
    header("Content-Disposition: filename=$name");
    header("Cache-Control: store, cache, must-revalidate, post-check=0, pre-check=0");
    header("Keep-Alive: close");
    }
    else
    {
    header("Cache-Control: store, cache, must-revalidate, post-check=0, pre-check=0");
    header("Content-type: application/octet-stream");
    header("Content-Disposition: attachment;filename=$name");
    }
    }$fp=fopen($strFullPath,"rb");
    fpassthru($fp);
    flush();
    exit;
    ?>