-1
我使用臨時鏈接腳本在PHP(http://www.kidmoses.com/blog-article.php?bid=53)中,它工作得很好,但問題是臨時鏈接不可恢復,也是如果文件大小超過4G,則不能下載。 爲了解決這個問題,我使用的是X-SENDFILE和我配置它像這樣=>X-Sendfile如果文件大小大於4G,則無法下載
- 的apt-get安裝中的libapache2-MOD-xsendfile
- 添加以下代碼到.htaccess文件
<IfModule mod_xsendfile.c> <Files *.php> XSendFile On SetEnv MOD_X_SENDFILE_ENABLED 1 </Files> </IfModule>
- 使用下面的代碼
<?php //We want to force a download box with the filename hello.txt header('Content-Disposition: attachment;filename=hello.txt'); //File is located at data/hello.txt header('X-Sendfile: data/hello.txt'); ?>
但它不工作, 當我想下載使用16G文件後4G的下載會失敗,你有什麼想法???