Page 1 of 1

cannot save epub

Posted: Fri Dec 02, 2016 10:00 pm
by IsleofGough
I have an epub generated from MadCap Flare which has several errors, making it impossible to upload to Amazon Kindle. I can open this in Oxygen XML editor and make the edits, but it does not allow these edits to be saved. I get the error message: Cannot save the file: null
Caused by: mimetype: bad entry CRC-32 '2cab616f expected a23b96c2. How can I fix this to allow saves? Thank you in advance.

Re: cannot save epub

Posted: Mon Dec 05, 2016 11:14 am
by Radu
Hi,

Oxygen uses a third party library to open and save EPUB archives. I'm not sure what the problem is, somehow the archive is probably corrupt in some way.
If you open the EPUB in a free ZIP utility like 7-ZIP, there is a toolbar "Test" button, it might report problems with the EPUB.

Regards,
Radu

Re: cannot save epub

Posted: Thu Dec 08, 2016 6:34 am
by IsleofGough
Unfortunately 7-Zip is Windows only. The issue is with the OSX version of Oxygen XML Author. The epub can be extracted if renamed "*.zip" and can be opened, edited, and saved in Calibre, Sigil, Jutoh, etc. I can save individual elements with "save as" in Oxygen, so I would agree that there is something about Oxygen's zip utility that is strange. I don't think it is the Flare output via Parallels itself, as no other program seems to have issues with the decompression/compression part. There is more than there should be of code errors in Flare, and I was hoping to fix these in Oxygen. I can fix them pretty well in Jutoh - but that is an epub only program (without the structured authoring features of Oxygen).

Re: cannot save epub

Posted: Mon Dec 12, 2016 7:17 pm
by adrian
Hi,

It was discussed in private and the issue is with the specific EPUB file. I'm mentioning this here in case anyone else encounters this with v18.1 or earlier.

The issue that Oxygen cannot overcome with the EPUB archive in question is that the "mimetype" file/entry is compressed/deflated, when it should be uncompressed/stored (as per the EPUB specification). Oxygen expects the "mimetype" file to always be uncompressed/stored and if it isn't (like in this case), it treats it as if it were corrupted, hence the unhelpful "bad entry CRC-32" error message.
This situation will be handled more gracefully in a future version, maybe raise a warning (or a non-fatal error).

In the long term, it would be preferable to correct the EPUB (as per the specs). A quick fix for an EPUB with this issue would be to Extract the "mimetype" file to a local folder, or simply create a new text file with the name "mimetype" (no file extension) with the content, of exactly 20 characters, "application/epub+zip" (without quotes or line break). Then in the Archive Browser remove the old "mimetype" file/entry from the EPUB and add it back (Add Files...) from the local folder.

If, for whatever reason, you don't want to fix the EPUB, to work around this issue in Oxygen, you can configure it to treat EPUB archives as plain ZIP archives and it will no longer complain about the EPUB "mimetype" being corrupt. You can do this in Options > Preferences, Archive. Delete the "epub" entry. Add a new entry for the "epub" extension with the type "zip". This will allow you to modify and save the file to the "tricky EPUB".
However, I would like to mention that I do not recommend keeping this setting in the long term (treating EPUB as ZIP). When you're done with this EPUB (or after fixing the mimetype), use the "Restore Defaults" button from the Archive preferences section to restore the epub association.

Regards,
Adrian

Re: cannot save epub

Posted: Sat Dec 17, 2016 1:51 am
by IsleofGough
I cannot thank the support team from Oxygen enough. The solution above works perfectly.

The compression of the mimetype appears to be a bug in Madcap Flare 2016R2 and can be replicated with even a blank file created from one of their templates. (Jutoh fixes this automatically when one imports and resaves the file, so it took awhile to figure out which ePubs could not be saved in Oxygen).

Oxygen XML editor works great with the file, so long as one follows the steps in the above post.

Re: cannot save epub

Posted: Thu May 25, 2017 11:16 pm
by urbie4
I'm getting the same error, but it's just when I go to create a child topic in Author 18.0. Not sure why -- I can edit and save existing topics, but when I try to Append Child or Insert After, I get that error message. It's not a directory permission issue, because I can create/save some other kind of file (e.g., a Word document) in the same folder.... :?:

Re: cannot save epub

Posted: Fri May 26, 2017 8:49 am
by Radu
Hi John,

So your particular problem is about using the Oxygen DITA Maps Manager right? But you obtain a similar Cannot save the file: null error message like the one discussed in this thread...
After you right click in the map and select "Append Child", do you use the "New" action to create a new topic on disk and append it to the DITA Map? Do you obtain that error after you choose the new file template? Does the error dialog have a "More details" link on it? Did this action ever work or does it work when saving in some folders but not in others?
If you are willing to investigate this further you can contact us via email (support@oxygenxml.com) and I can give you details about enabling logging in the application so that we can find out where the save operation breaks in our code (probably not related with file permissions though).

Regards,
Radu