View Single Post
Old 08-03-2014, 04:09 AM   #10
french imp
Member
french imp began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2012
Device: kobo
Hi Davidfor,
here's a minimal code exemplifying the problem :
PHP Code:
<?php

// minimal code to illustrate the problem
// this file is epub_test.php
// some epub file test.php should be in the same directory
// the file displays a download button, which works with ff
// but not with the kobo's browser

if (isset($_POST['submit'])) {
    
// code for downloading the epub file
    
$path "";
    
$file "test.epub";
    
header("Content-type: application/epub+zip");
    
header("Content-Disposition: attachment; filename=\"$file\"");
    
header("Expires: 0");
    
header("Cache-Control: no-cache, must-revalidate");
    
header("Pragma: no-cache");
    
readfile($path.$file);
} else {
    
// form with the trigger button
    
echo "<form method = 'post' action = 'epub_test.php'><input type='submit' name='submit' value='Download epub'></form>";

?>
Thanks again!
french imp is offline   Reply With Quote