View Single Post
Old 04-04-2012, 11:23 AM   #3603
BenChen
EPUB Metadata ******
BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.
 
Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
Quote:
Originally Posted by Analogus View Post
So I would need a function which gives 0 or 1 wether it's an epub or not. Some ideas?
Hi there,

If you know the path of the current book, you can get the mime type using

Code:
mime = FileSystem.getMIMEType(path);
If the book is an EPUB, mime will be 'application/epub+zip'.

You can get the path of the current book using

Code:
path = kbook.model.currentBook.media.path;
Hope this helps.

Sincerely,
Ben.
BenChen is offline   Reply With Quote