Skip to main content
Inspiring
December 30, 2017
Answered

How to 'break open' epub and then rezip without errors

  • December 30, 2017
  • 3 replies
  • 6671 views

I've managed to break open an .epub file by renaming it .zip and unzipping. I've done some edits in the HTML (simply deleted a div) and then rezipped it. However upon rezipping I get an error and whichever device I use can no longer read the .epub file. Something has happened to the structure when zipping back to an .epub file.

Any tips on avoiding this?

This topic has been closed for replies.
Correct answer BobLevine

Much easier on Windows. Open the file in Windows Explorer but don’t extract it.

MOVE (don’t copy) the HTML/CSS folder to the desktop and do whatever it is you need to do. Then move it back and rename the zip file with the EPUB extension.

3 replies

FeAle-7IZsBx
Participating Frequently
January 5, 2018

Hi,

When I start to work with ePUB, early 2009, I had the same problem unknownsailor

Now I only use - http://www.docdataflow.com/ecancrusher/ for MAC and Windows. It´s is very friendly user, just darg and drop the ePUB file over the app to unzip. After move the folder over the app again, to zip it.

Regards

Participant
September 20, 2023

Hey, 

I literally created an account so that I could reply to this comment.

I have been struggling to open ePUB files on my reader and after I tried Docdataflow, it worked and I was about to cry because of how happy it made me.

Thank you so very much for this tip.

James Gifford—NitroPress
Legend
September 20, 2023

There seems to be a specific glitch in the way MacOS handles ZIP archiving. The MIMETYPE file must be in plain, uncompressed format to be read correctly, and (to the best of my knowledge) all Windows-based tools and processes are sensible and don't attempt to encode or compress this 21-byte file. Macs insist, against all efforts, on encoding it. The only workaround I know of is to re-ZIP the file, then use a specific "store uncompressed" command to write the MIMETYPE file into the archive without compression. (Uunfortuinately, I've never been given a clear set of directions on how to do that under MacOS.)

 

But that's the core of the problem, and it can be overcome with a bit of savvy, not requiring any specific archiving tool or utility.

Derek Cross
Community Expert
Community Expert
December 31, 2017

To any Mac users following this thread, I'd recommend BBEdit Bare Bones Software | BBEdit 12

BobLevine
Community Expert
Community Expert
December 30, 2017

Mac or Windows?

Inspiring
December 30, 2017

Sorry, Windows.

BobLevine
Community Expert
BobLevineCommunity ExpertCorrect answer
Community Expert
December 30, 2017

Much easier on Windows. Open the file in Windows Explorer but don’t extract it.

MOVE (don’t copy) the HTML/CSS folder to the desktop and do whatever it is you need to do. Then move it back and rename the zip file with the EPUB extension.