title_body: How is an epub structured internally? I know from sources I do not remember anymore, that an epub file is a valid zip file containing (among other files) chapters as *.xhtml files, a manifest file content.opf and a table of contents file toc.ncx.
  
  
  What is the file and directory structure of an unpacked epub?
  Which files must be there (with fixed names?) and are there optional files?
  What information is stored in the single files?
  
  
  I am asking for a very basic epub file, so the version should not matter, but assume epub2 in case it makes a difference for you.
  
  PS: I will probably ask for the content and structure of those files later, but for now I only want to know about which files are mandatory or optional and an overview what they contain, to keep the question more specific and answers short.
upvoted_answer: EPUB is an open format so you can find the standard specifications online. Wikipedia has a good article on the EPUB format. 
  
  If you want a brief description of the characteristics you just mentioned you can find in this article here.
  
  Directory structure:
  
  EpubFolderYouWant
     META-INF
        container.xml
     mimetype
     content.opf
     toc.ncx
  
  
  Needed files:
  
  mimetype
  container.xml
  content.opf
  toc.ncx
  
  
  And which information is contained in each file is described in the above mentioned article.