Fix default config to reduce the minimum things to change.

Removed Nginx limitations which are not true anymore.
This commit is contained in:
Sébastien Lucas 2013-01-20 13:49:08 +01:00
parent 11645b2155
commit d2d639dcd5
2 changed files with 10 additions and 6 deletions

View file

@ -98,13 +98,18 @@
header('Content-Disposition: attachment; filename="' . basename ($file) . '"');
}
$dir = $config['calibre_internal_directory'];
if (empty ($config['calibre_internal_directory'])) {
$dir = $config['calibre_directory'];
}
if (empty ($config['cops_x_accel_redirect'])) {
$filename = $config['calibre_internal_directory'] . $file;
$filename = $dir . $file;
$fp = fopen($filename, 'rb');
header("Content-Length: " . filesize($filename));
fpassthru($fp);
}
else {
header ($config['cops_x_accel_redirect'] . ": " . $config['calibre_internal_directory'] . $file);
header ($config['cops_x_accel_redirect'] . ": " . $dir . $file);
}
?>