Commit 4fb3c33c authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3615 / download.php: Das Popup schliesst nicht automatisch bei ZIP, im FF, Warnung in der Console

Fix from BB seems to help in 90%: window.onblur().
QuickFormQuery.php: Add 'windows.onblur'
parent f5d7ba73
......@@ -946,6 +946,9 @@ class QuickFormQuery {
</div>
</div>
</div>
<script type="application/javascript">
window.onblur = function () { $("#qfqModal101").modal('hide'); }
</script>
EOF;
return $code;
......
......@@ -139,21 +139,12 @@ class Download {
private function outputFile($filename, $outputFilename) {
$length = filesize($filename);
// $mimetype = mime_content_type($filename);
$outputFilename = $this->targetFilenameExtension($filename, $outputFilename, $mimetype);
// // In case there is a wrong filenameextension on the outputFilename: extend it.
// $ext = '.' . substr($mimetype, strrpos($mimetype, '/') + 1);
// $len = strlen($ext);
// if (substr($outputFilename, 0 - $len) != $ext) {
// $outputFilename .= $ext;
// }
header("Content-type: $mimetype");
header("Content-Length: $length");
// No idea if 'attachment' has disadvantages.
// header("Content-Disposition: attachment; filename=$outputFilename");
// 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");
header("Pragma: no-cache");
header("Expires: 0");
......
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