Last change
on this file since 23167 was
23167,
checked in by mistic100, 11 years ago
|
replace readfile by readlargefile, add advanced parameter to use http redirection instead of php download
|
File size:
893 bytes
|
Line | |
---|
1 | <?php |
---|
2 | define('PHPWG_ROOT_PATH', '../../'); |
---|
3 | include(PHPWG_ROOT_PATH.'include/common.inc.php'); |
---|
4 | |
---|
5 | check_status(ACCESS_GUEST); |
---|
6 | |
---|
7 | try { |
---|
8 | $BatchDownloader = new BatchDownloader($_GET['set_id']); |
---|
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).''); |
---|
22 | |
---|
23 | header('Cache-Control: no-cache, must-revalidate'); |
---|
24 | header('Pragma: no-cache'); |
---|
25 | header('Expires: 0'); |
---|
26 | |
---|
27 | readlargefile($file); |
---|
28 | } |
---|
29 | } |
---|
30 | catch (Exception $e) |
---|
31 | { |
---|
32 | echo $e->getMessage(); |
---|
33 | } |
---|
34 | |
---|
35 | exit(0); |
---|
36 | |
---|
37 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.