Changeset 23167
- Timestamp:
- Jun 13, 2013, 12:19:50 PM (11 years ago)
- Location:
- extensions/BatchDownloader
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/BatchDownloader/download.php
r18973 r23167 8 8 $BatchDownloader = new BatchDownloader($_GET['set_id']); 9 9 $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).''); 10 22 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'); 16 26 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 } 22 29 } 23 30 catch (Exception $e) -
extensions/BatchDownloader/include/functions.inc.php
r16592 r23167 101 101 } 102 102 103 // https://bugs.php.net/bug.php?id=61636 104 function readlargefile($fullfile) 105 { 106 $fp = fopen($fullfile, 'rb'); 107 108 if ($fp) 109 { 110 while (!feof($fp)) 111 { 112 print(fread($fp, 2097152)); 113 } 114 115 fclose($fp); 116 } 117 } 118 103 119 ?> -
extensions/BatchDownloader/main.inc.php
r18973 r23167 8 8 Author URI: http://www.strangeplanet.fr 9 9 */ 10 11 /* 12 * advanced config: 13 * $conf['batch_download_max_elements'] max value of the elements slider (default 1000) 14 * $conf['batch_download_max_size'] max value of the size slider (default 500) 15 * $conf['batch_download_force_pclzip'] if true, force the usage of PclZip instead of ZipArchive 16 * $conf['batch_download_direct'] if true, the download script will redirect to the zip instead of deliver it through PHP 17 */ 10 18 11 19 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
Note: See TracChangeset
for help on using the changeset viewer.