function epub_reset_mimetype in Epub 7
Same name and namespace in other branches
- 8 epub.module \epub_reset_mimetype()
2 calls to epub_reset_mimetype()
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;
}