diff options
Diffstat (limited to 'apis/download.inc.php')
-rw-r--r-- | apis/download.inc.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apis/download.inc.php b/apis/download.inc.php index b9033c6f..898e34ff 100644 --- a/apis/download.inc.php +++ b/apis/download.inc.php @@ -35,7 +35,7 @@ if (isset($_REQUEST['progress'])) { } } fclose($fh); - if ($error === false && $pid > 0 && $percent != 100 && !posix_kill($pid, 0)) $error = 'Process died - ' . $line; + if ($error === false && $pid > 0 && $percent != 100 && !posix_kill($pid, 0)) $error = "Process $pid died - " . file_get_contents($log); if ($error !== false) { echo Render::parse('download-error', array('file' => $file, 'code' => $error)); unlink($log); @@ -80,6 +80,11 @@ if (file_exists($local . '/' . $file) && !$overwrite) { exit(0); } +if (file_exists($local . '/' . $file) && !is_writable($local . '/' . $file)) { + echo Render::parse('download-error', array('file' => $local . '/' . $file, 'remote' => $remote, 'code' => 'Local file is not writable')); + exit(0); +} + if ($directExec) { // Blocking inline download $ret = Util::downloadToFile($local . '/' . $file, $remote . '/' . $file, 20, $code); |