View Single Post
Old 01-13-2013, 02:40 PM   #231
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
Posts: 352
Karma: 37761
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
Quote:
Originally Posted by Kevnancy View Post
Dear all,

I return towards you because I still have a problem under IIS. I installed COPDS under IIS8 and I can see my books under the web interface or with OPDS catalog.

But when I want to download a book (mobi ou ebook) on my tablett ou my PC, I have the HTTP 404 error....

See the log file for IIS:

Code:
#Date: 2013-01-13 14:49:37
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2013-01-13 14:49:37 192.168.0.11 GET / - 8080 - 192.168.0.25 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.11+(KHTML,+like+Gecko)+Chrome/23.0.1271.97+Safari/537.11 - 200 0 0 233
2013-01-13 14:49:41 192.168.0.11 GET /index.php page=6 8080 - 192.168.0.25 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.11+(KHTML,+like+Gecko)+Chrome/23.0.1271.97+Safari/537.11 http://192.168.0.11:8080/ 200 0 0 93
2013-01-13 14:49:42 192.168.0.11 GET /index.php page=7&id=1 8080 - 192.168.0.25 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.11+(KHTML,+like+Gecko)+Chrome/23.0.1271.97+Safari/537.11 http://192.168.0.11:8080/index.php?page=6 200 0 0 93
2013-01-13 14:49:43 192.168.0.11 GET /Z:/Calibre+Server/Ebook/Brown,Dan/Anges+et+demons+(3)/Anges+et+demons+-+Brown,Dan.mobi - 8080 - 192.168.0.25 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.11+(KHTML,+like+Gecko)+Chrome/23.0.1271.97+Safari/537.11 http://192.168.0.11:8080/index.php?page=7&id=1 404 0 2 62
I don't understand why I can't download it...
First can you tell what you did top make it work with Calibre directory in a shared drive (Z ? I'm curious.

About the download. If your Calibre library is outside your webdir (which is good), you have to fill that config item :

$config['cops_x_accel_redirect'] = "X-Sendfile";

But with IIS it doesn't seems that X-Sendfile is available and there is no alternative (correct me if I'm wrong).

So please try to edit fetch.php and replace the last lines by :
Code:
    if ($type == "jpg") {
        header('Content-Disposition: filename="' . basename ($file) . '"');
    } else {
        header('Content-Disposition: attachment; filename="' . basename ($file) . '"');
    }
    //header ($config['cops_x_accel_redirect'] . ": " . $config['calibre_internal_directory'] . $file);
    $fp = fopen($config['calibre_internal_directory'] . $file, 'rb');
    header("Content-Length: " . filesize($config['calibre_internal_directory'] . $file));
    fpassthru($fp);
?>
Make sure that $config['calibre_internal_directory'] has the same value than $config['calibre_directory'].

Beware I did not test the code but there should be no risk.
vlad59 is offline   Reply With Quote