PHP readfile() and large files

后端 未结 7 855
逝去的感伤
逝去的感伤 2020-12-05 20:12

When using readfile() -- using PHP on Apache -- is the file immediately read into Apache\'s output buffer and the PHP script execution completed, or does the PHP script exec

7条回答
  •  孤城傲影
    2020-12-05 20:32

    Under Apache, there is a nice elgant solution not involving php at all:

    Just place an .htaccess config file into the folder containing the files to be offered for download with the following contents:

    
    ForceType applicaton/octet-stream
    
    

    This tells the Apache to offer all files in this folder (and all its subfolders) for download, instead of directly displaying them in the browser.

提交回复
热议问题