Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 02-21-2012, 05:55 AM   #1
escape
Junior Member
escape began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2012
Device: Kobo touch
Browser-Download of epub Files

Im working on a standalone browser library for Kobo Touch users.
I have a big problem about the download function. When ever i open a Link to an .epub-File, the browser does not download it. It just opens the file cryptik inside the browser that freezes after that. First i thought: there is no way it could be solved. But gutenberg.org does have a solution for that. Also it works inside the calibre library that you reach through your webbrowser.

How do they get the files to download? Or easier: How do they bring up the box that asks if file should be downloadet or not?

Sorry for my bad english
escape is offline   Reply With Quote
Old 02-21-2012, 07:43 AM   #2
Aydan
Connoisseur
Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.
 
Posts: 74
Karma: 317
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
Have a look at the mime type sent by the server. This should control how the browser reacts.

Regards
Aydan
Aydan is offline   Reply With Quote
Old 02-21-2012, 08:36 AM   #3
escape
Junior Member
escape began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2012
Device: Kobo touch
<a type="application/octet-stream" href="xxx.epub">
or
<a type="application/epub+zip" href="xxx.epub">
or
<a type="application/force-download" href="xxx.epub">
did not work.

The header manipulation inside the file did also not work.

Any other hints?
escape is offline   Reply With Quote
Old 02-21-2012, 08:50 AM   #4
Aydan
Connoisseur
Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.
 
Posts: 74
Karma: 317
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
Check the HTTP response header of your response.
This is what project gutenberg spits out as an example:
Quote:
Status: HTTP/1.1 200 OK
Server: Apache
Content-Disposition: attachment; filename=pg38934-images.epub
X-Rate-Limiter: php
Cache-Control: max-age=86400
X-Frame-Options: sameorigin
Content-Type: application/epub+zip
Content-Length: 281011
X-Powered-By: 3
X-Hits: 1
Date: Tue, 21 Feb 2012 13:48:47 GMT
X-Varnish: 1635092337 1635083511
Age: 323
Via: 1.1 varnish
Connection: close
I got this info via web-sniffer.net

Regards
Aydan
Aydan is offline   Reply With Quote
Old 02-21-2012, 08:57 AM   #5
escape
Junior Member
escape began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2012
Device: Kobo touch
Quote:
Status: HTTP/1.1 200 OK
Date: Tue, 21 Feb 2012 13:55:45 GMT
Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny13 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g
Last-Modified: Sat, 21 Jan 2012 09:44:11 GMT
ETag: "23b000a-49800-4b706a3b3d0c0"
Accept-Ranges: bytes
Content-Length: 301056
Connection: close
Content-Type: text/plain
So thats the fault.

But how can i change it without touching the apache settings?
escape is offline   Reply With Quote
Old 02-21-2012, 09:03 AM   #6
Aydan
Connoisseur
Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.Aydan has a complete set of Star Wars action figures.
 
Posts: 74
Karma: 317
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
You'll have to tell apache that epub is not text/plain.
look here

Regards
Aydan
Aydan is offline   Reply With Quote
Old 02-21-2012, 09:11 AM   #7
escape
Junior Member
escape began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2012
Device: Kobo touch
thanks for the answer.. so now i see that my hoster does not make the right settings for epubs.

escape is offline   Reply With Quote
Old 02-21-2012, 01:19 PM   #8
rashkae
Addict
rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.
 
rashkae's Avatar
 
Posts: 280
Karma: 261602
Join Date: Jun 2011
Location: Ontario, Canada
Device: Kobo Aura HD
The real culprit here is the damnabe "mime magic" plugin that Apache installs by default. Without this plugin, any file with an extension that Apache doesn't recognized gets passed to the browser as binary-bin. At worst case, that means the browser will at least let you download/save the file (without requiring a right-click save link as...) I've seen that mime magic cause *all* kinds of mischief by mis-identifying files as text.
rashkae is offline   Reply With Quote
Old 02-21-2012, 02:31 PM   #9
escape
Junior Member
escape began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2012
Device: Kobo touch
I asked my hoster but he won't change the settings on the Apache config.

Is there any easy and working MIME-Type configuration inside the webpage possible? Without htaccess?
escape is offline   Reply With Quote
Old 02-22-2012, 10:09 AM   #10
voom
Just me :)
voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.voom is no ebook tyro.
 
Posts: 106
Karma: 1282
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
If you have PHP available sth. like this should do the trick:

http://www.ryboe.com/tutorials/php-h...force-download
voom is offline   Reply With Quote
Old 02-23-2012, 07:42 AM   #11
escape
Junior Member
escape began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2012
Device: Kobo touch
The problem is:

The KoboBrowser does not open URLs which begin with header manipulation...

Dont ask me why.
escape is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't download from browser in Android TallMomof2 Devices 17 10-19-2011 09:58 AM
Download PDF through browser? bberrry Amazon Kindle 3 02-18-2011 05:27 AM
PB 602: EPUB Download via Browser miwie PocketBook 1 11-29-2010 04:50 AM
Classic Download *ePUB* to Computer via Browser? EatingPie Barnes & Noble NOOK 18 11-11-2010 04:23 PM


All times are GMT -4. The time now is 12:17 AM.


MobileRead.com is a privately owned, operated and funded community.