Commit ebc0a693 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Download Excel (and all other download types): Content-Disposition header...

Download Excel (and all other download types): Content-Disposition header delivered/suppressed in the opposite meaning as it should be. Seems to be fixed now.
parent a2a51ca7
Pipeline #1268 passed with stage
in 1 minute and 47 seconds
......@@ -22,24 +22,24 @@ require_once(__DIR__ . '/../core/exceptions/ErrorHandler.php');
set_error_handler("\\qfq\\ErrorHandler::exception_error_handler");
$error = '';
$output = '';
try {
try {
$download = new Download();
// If all is fine: process() will output file via print() !!
$error = $download->process(STORE_SIP, OUTPUT_MODE_DIRECT);
$output = $download->process(STORE_SIP, OUTPUT_MODE_DIRECT);
} catch (qfq\CodeException $e) {
$error = $e->formatMessage();
$output = $e->formatMessage();
} catch (qfq\DbException $e) {
$error = $e->formatMessage();
$output = $e->formatMessage();
} catch (qfq\DownloadException $e) {
$error = $e->formatMessage();
$output = $e->formatMessage();
}
} catch (\Exception $e) {
$error = "Exception: " . $e->getMessage();
$output = "Exception: " . $e->getMessage();
}
echo $error;
echo $output;
......@@ -207,7 +207,7 @@ class Download {
header("Content-type: $mimeType");
header("Content-Length: $length");
if ($flagJson) {
if (!$flagJson) {
// If defined as 'attachment': PDFs are not shown inside the browser (if user configured that). Instead, always a 'save as'-dialog appears (Chrome, FF)
// header("Content-Disposition: attachment; filename=$outputFilename");
header("Content-Disposition: inline; filename=\"$outputFilename\"; name=\"$outputFilename\"");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment