<?php
$dir="./";  //文件的目录
header("content-type: application/file"); 
header("content-disposition: attachment; filename=$filename");
readfile("$dir/$filename");
?>

解决方案 »

  1.   

    phpteam ,我已经说过了用PHP做转向,而不是通过读取文件发送到客户端的方式。这种方法太消耗系统资源所以我没采用。
      

  2.   

    没听懂你的意思,用PHP做转向,直接转到要下的文件吗???那文件名怎么可能会变呢??
      

  3.   

    我都不知道怎么做,哪里来的代码呢?请我问问吧,其实我也觉得不太可能实现,这个需要web服务器端的配合,抱着一线希望吧。
      

  4.   

    header("Content-type: application/file");
    header("Content-Disposition: attachment; filename=$filename");//缺省时文件保存对话框中的文件名称
    header("location:要下载的文件地址");