X-Sendfile if file size be more than 4G it coulden't be downloaded

212 views Asked by At

I'm using Temporary Links Script In PHP (http://www.kidmoses.com/blog-article.php?bid=53) and it works very well, but the problem is that the Temporary Links are not resumable, also if file size be more than 4G it coulden't be downloaded. For solving this problem i use X-Sendfile and and i configure it it like this =>

  • apt-get install libapache2-mod-xsendfile
  • add following code to .htaccess file
<IfModule mod_xsendfile.c>
  <Files *.php>
    XSendFile On
    SetEnv MOD_X_SENDFILE_ENABLED 1
  </Files>
</IfModule>
  • Use the following code
  <?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'); 
  ?>

But it doesn't work, When i want to download a file with 16G after 4G the download will be failed, do you have any idea ???

1

There are 1 answers

0
Ralf Mattes On

Two things to check:

  • your client can handle files > 4Gb
  • does the server run on a 64bit OS? Otherwise the file size reported by a stat call might be wrong.