Skip to content
Snippets Groups Projects
Commit 332a79c8 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

All PDF files will be downloaded

parent 526d6e1c
Branches
No related tags found
No related merge requests found
......@@ -250,14 +250,16 @@ class ProxyController extends Controller
$body = $htmlDocument->getResult();
break;
case 'application/pdf':
if (!isset($answer["headers"]["content-disposition"])) {
$name = "document.pdf";
$basename = basename($targetUrl);
if (stripos($basename, ".pdf") !== false) {
$name = $basename;
}
$answer["headers"]["content-disposition"] = "attachment; filename=$name";
}
// We will download all PDF Files
// File Downloads aren't working anymore within an IFrame.
// We will show the user a page to download the File
$postData = \App\Http\Controllers\DownloadController::generateDownloadLinkParameters($targetUrl);
return response(view("downloadrequired")->with([
"url" => $postData["url"],
"validuntil" => $postData["valid-until"],
"password" => $postData["password"]
]), 413);
break;
// no break
case 'image/png':
case 'image/jpeg':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment