Menu

#45 Wrong mimetype for .epub files

v1.0_(example)
closed
nobody
None
1
2017-06-04
2016-09-14
Ahmad Samir
No

Hello.

Trying to open a .epub file with FBReader always fails with an error message of something like:
"application to open blah.epub is not available"

I have to use "Open With" every time I want to open an epub with FBReader.

Looking at the source code of Ghose Commander I see that the mimetype of .epub is defined as "application/epub"; changing that to "application/epub+zip" fixes the issue.

Index: src/com/ghostsq/commander/utils/Utils.java
===================================================================
--- src/com/ghostsq/commander/utils/Utils.java  (revision 556)
+++ src/com/ghostsq/commander/utils/Utils.java  (working copy)
@@ -61,7 +61,7 @@
             { ".djvu", "image/vnd.djvu", C_IMAGE },
             { ".doc",  "application/msword", C_OFFICE },
             { ".docx", "application/msword", C_OFFICE },
-            { ".epub", "application/epub", C_BOOK }, 
+            { ".epub", "application/epub+zip", C_BOOK }, 
             { ".fb2",  "application/fb2", C_BOOK },
             { ".flac", "audio/flac", C_AUDIO },            
             { ".flv",  "video/x-flv", C_VIDEO },            
@@ -805,4 +805,4 @@
             return r;
         }
     };
-}
\ No newline at end of file
+}

AFAIK the correct mimetype for .epub files is "application/epub+zip"; according to these sources anyway:
http://www.idpf.org/epub/301/spec/epub-ocf.html#app-media-type
https://en.wikipedia.org/wiki/EPUB

Thanks in advance.

Discussion

  • zc2

    zc2 - 2017-06-04
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB