View Single Post
Old 10-12-2012, 03:24 AM   #135
Northguy began at the beginning.
Posts: 20
Karma: 10
Join Date: Oct 2011
Device: Sony PRS-T1
Originally Posted by akenarf View Post

//readfile($config['calibre_internal_directory'] . $file);
header('Content-Length: ' . filesize($config['calibre_internal_directory'] . $file));
fpassthru(fopen($config['calibre_internal_directory'] . $file, 'rb'));

not sure why this is the case, but it all works great now..! :-)
Whan patching this code, will this also work as a replacement for the code I needed to implement on my machine?

Edit the file fetch.php and put // before the last two lines.

// header("Content-Type: application/force-download");

// header ($config['cops_x_accel_redirect'] . ": " . $config['calibre_internal_directory'] . $file);

Add this line below the lines above.

readfile($config['calibre_internal_directory'] . $file);
Maybe it is possible while patching to make the code more uniform and make this an optional feature, based on the choice of setting
$config['cops_x_accel_redirect'] = "location";
If the option is generic I can do a Git Pull without the need of first saving my personal modification.
Northguy is offline   Reply With Quote