如果可以,是不是html的文件也可以直接下载,那么,时不是.php,.asp的文件也能直接下载。
太恐怖了

解决方案 »

  1.   

    这个是跟用户本身的文件类型设置有关系吧。
    你从
    文件夹选项-文件类型-找到txt-高级-第一个多选框(“下载后确定打开”)勾上
    你就可以看到效果了
      

  2.   

    <?php
    // We'll be outputting a txt
    header('Content-type: application/txt');// It will be called downloaded.txt
    header('Content-Disposition: attachment; filename="downloaded.txt"');// The PDF source is in original.txt
    readfile('original.txt');
    ?>