You are here

function epub_reset_mimetype in Epub 7

Same name and namespace in other branches
  1. 8 epub.module \epub_reset_mimetype()
2 calls to epub_reset_mimetype()
drush_epub_flush in ./epub.drush.inc
epub_install in ./epub.install

File

./epub.module, line 17

Code

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