We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4918fda + cfb55d2 commit 22a8d30Copy full SHA for 22a8d30
web/download/file/index.php
@@ -13,10 +13,20 @@
13
14
$path = $_REQUEST['path'];
15
if (!empty($path)) {
16
+ set_time_limit(0);
17
+ if (ob_get_level()) {
18
+ ob_end_clean();
19
+ }
20
header("Content-type: application/octet-stream");
21
header("Content-Transfer-Encoding: binary");
22
header("Content-disposition: attachment;filename=".basename($path));
- passthru(VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($path));
23
+ $output = '';
24
+ exec(VESTA_CMD . "v-check-fs-permission " . $user . " " . escapeshellarg($path), $output, $return_var);
25
+ if ($return_var != 0) {
26
+ print 'Error while opening file'; // todo: handle this more styled
27
+ exit;
28
29
+ readfile($path);
30
exit;
31
} else {
32
die('File not found');
0 commit comments