View Full Version : ePUB and deflate/gzip


Barnsy
07-13-2009, 08:13 PM
Hi All,

I thought I'd just share with you something I encountered recently when adding ePUB files for download on my website (Promotional link removed - MODERATOR]. Maybe it might help someone in the future.

My site is running ASP.NET and is using .NET to deflate/gzip content. This included downloaded files (PDF, ePUB and Mobi). To my surprise, it seems that deflate was dropping the last 4 bytes on the ePUB files. I didn't bother open the ePUB files with a hex editor to see what the last 4 bytes were but in notepad they looked like blanks (whitespace). When trying to load the ePUB files into calibre I was told that they weren't valid zip files. Funny enough, if I renamed the files .zip, winzip would extract them just fine. Oh well.

Anyways, long story short, I stopped using deflate/gzip for my download files and the problem is solved.

kovidgoyal
07-13-2009, 08:42 PM
There isn't much point in using deflate on EPUb since EPUB is zipped anyway.

Barnsy
07-13-2009, 09:56 PM
Good to know it won't affect my bandwidth too badly.

Thanks, by-the-way for calibre - it's Great! I will be making a donation once I get a little closer to being in the black ;)