After playing around with the excellent pandoc, I decided to try and make epub books and pdf files from markdown articles. Pdf worked fine, but on e.g. android it was not possible to download the epub files. It just said it could not recognize the file format.
I checked the gutenberg project and examined the headers, which gave the following result:
Array (  => HTTP/1.1 200 OK  => Server: Apache  => X-Rate-Limiter: ratelimiter2.php  => Set-Cookie: session_id=8b0c13d8276098a7158afcfb13cac0d21d2b30f5; Domain=.gutenberg.org; expires=Mon, 06 Jan 2014 13:19:06 GMT; Path=/  => X-Frame-Options: sameorigin  => X-Connection: Close  => Content-Type: application/epub+zip  => Content-Length: 285830  => X-Powered-By: 3  => Date: Mon, 06 Jan 2014 12:49:06 GMT  => X-Varnish: 835261757  => Age: 0  => Via: 1.1 varnish  => Connection: close )
What should be noticed is really just this header:
To fix the missing downloads of epub books you will need to enable the
and then add the following lines to your hosts configuration:
<IfModule mod_headers.c> <FilesMatch "\.(epub)$"> ForceType application/epub+zip Header set Content-Disposition "attachment" Allow from all </FilesMatch> </IfModule>
Then download of
epubs will work from your android device.
You should be able to the same trick for
.mobi files (kindle e-reader files). Add the following to your apache2 configuration file:
<IfModule mod_headers.c> <FilesMatch "\.(mobi)$"> ForceType application/mobi+zip Header set Content-Disposition "attachment" Allow from all </FilesMatch> </IfModule>
This page has been viewed 2971 times. First hit: 30-Oct-2015 16:56:48
Share email, Google+, Twitter, Facebook.
comments powered by Disqus