You are here

function epub_reset_mimetype in Epub 8

Same name and namespace in other branches
  1. 7 epub.module \epub_reset_mimetype()
1 call to epub_reset_mimetype()
drush_epub_flush in drush/epub.drush.inc
Reset file mime type for epub files.

File

./epub.module, line 80

Code

function epub_reset_mimetype($file) {
  $tmp = explode('.', $file
    ->getFilename());
  $file_extension = end($tmp);
  switch ($file_extension) {
    case 'ibooks':
      $file
        ->setMimeType('application/x-ibooks+zip');
      return $file
        ->save();
  }
  return FALSE;
}