Ignore:
Timestamp:
Jun 13, 2013, 12:19:50 PM (11 years ago)
Author:
mistic100
Message:

replace readfile by readlargefile, add advanced parameter to use http redirection instead of php download

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/download.php

    r18973 r23167  
    88  $BatchDownloader = new BatchDownloader($_GET['set_id']);
    99  $file = $BatchDownloader->getArchivePath();
     10 
     11  if (isset($conf['batch_download_direct']) and $conf['batch_download_direct'])
     12  {
     13    header('Location: '.$file);
     14  }
     15  else
     16  {
     17    header('Content-Type: application/force-download; name="'.basename($file).'"');
     18    header('Content-Disposition: attachment; filename="'.basename($file).'"');
     19    header('Content-Description: File Transfer');
     20    header('Content-Transfer-Encoding: binary');
     21    header('Content-Length: '.filesize($file).'');
    1022
    11   header('Content-Type: application/force-download; name="'.basename($file).'"');
    12   header('Content-Disposition: attachment; filename="'.basename($file).'"');
    13   header('Content-Description: File Transfer');
    14   header('Content-Transfer-Encoding: binary');
    15   header('Content-Length: '.filesize($file).'');
     23    header('Cache-Control: no-cache, must-revalidate');
     24    header('Pragma: no-cache');
     25    header('Expires: 0');
    1626
    17   header('Cache-Control: no-cache, must-revalidate');
    18   header('Pragma: no-cache');
    19   header('Expires: 0');
    20 
    21   readfile($file);
     27    readlargefile($file);
     28  }
    2229}
    2330catch (Exception $e)
Note: See TracChangeset for help on using the changeset viewer.