2017-09-06 62 views
-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的下載會失敗,你有什麼想法???

回答

1

兩件事情來檢查:

  • 您的客戶機可以處理的文件>的4Gb
  • 確實對64位操作系統的服務器運行?否則 統計調用報告的文件大小可能是錯誤的。