From a2a49a376eec581525ef694cfcbbe8186716beac Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sun, 5 Dec 2021 12:54:53 -0600 Subject: [PATCH] Add the @download attribute to ebook download links --- config/apache/standardebooks.org.conf | 1 + config/apache/standardebooks.test.conf | 1 + www/ebooks/ebook.php | 11 ++++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/apache/standardebooks.org.conf b/config/apache/standardebooks.org.conf index 63ef8275..9208a1bd 100644 --- a/config/apache/standardebooks.org.conf +++ b/config/apache/standardebooks.org.conf @@ -94,6 +94,7 @@ Define domain standardebooks.org # Serve distributables using the "download" dialog instead of opening in-browser # Note: the trailing e in the Header directive is required + # In modern browsers this is handled with the a@download attribute, we keep this here for compatibility SetEnvIf Request_URI ^/ebooks/.+?/downloads/(.+)$ FILENAME=$1 Header set Content-Disposition "attachment; filename=%{FILENAME}e" diff --git a/config/apache/standardebooks.test.conf b/config/apache/standardebooks.test.conf index 01615528..58f17323 100644 --- a/config/apache/standardebooks.test.conf +++ b/config/apache/standardebooks.test.conf @@ -93,6 +93,7 @@ Define domain standardebooks.test # Serve distributables using the "download" dialog instead of opening in-browser # Note: the trailing e in the Header directive is required + # In modern browsers this is handled with the a@download attribute, we keep this here for compatibility SetEnvIf Request_URI ^/ebooks/.+?/downloads/(.+)$ FILENAME=$1 Header set Content-Disposition "attachment; filename=%{FILENAME}e" diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index 662f0933..931875ce 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -174,12 +174,13 @@ catch(\Exception $ex){

Download for ereaders