我想在进入php页面,点击某个doc文档然后出现下载保存的界面然后下载下来,怎么写,请大家多多指教谢谢....急!!

解决方案 »

  1.   

    不是点击到那个.doc 文件就会自动下载的吗?
      

  2.   

    header("Content-type: application/x-download");
    header("Content-Disposition: attachment; filename=".$_GET['file_download_name'].";");
    header("Accept-Ranges: bytes");
    header("Content-Length: ".filesize($_GET['file_download_name'])."");
    header("Content-type: ".mime_content_type($_GET['file_download_name'])."");
    readfile($_GET['file_download_name']);
      

  3.   

    这根本不是PHP的内容
    完全是HTML
    浏览器只能识别为数不多的后缀,比如:htm,html,asp,aspx,php,jsp等 其它的都会自动将其下载.