Downloading ePub - a simple ePub Reader question

I am developing a simple epub reader on an iPhone, but wondering how to download it. I know that reading files such as PDFs is somewhat simple, because one file is on its own and can be downloaded using UIWebView or CoreGraphics. This is in contrast to ePub, which requires a bit more work to get (parsing xml ... etc.) the Content, since it is essentially a ZIP file.

Now, as I thought, this is done as follows. But I'm not sure if it is correct:

  • Upload the book.epub file to UserDomain, as in this example
  • Unzip the book.epub file to create a book directory where all the content will be
  • In the created book, find access to the files and perform the necessary ones (extract, parse, etc.).
  • When the epub is downloaded or the application is closed, delete the unpacked version - dir directory
  • Unpack the loop again when opening the book.

If I cannot directly access the contents of the ePub file, I think there is no need to unzip them ... which is unlikely because it is a ZIP.

Thanks in advance for any help. :)

Regards, oonoo

+4
source share
1 answer

It all looks good to me. Another option is to extract the zip contents into NSData objects in memory, but this may not work with extremely large files.

0
source

All Articles