mime types - What is correct mimetype with Apache OpenOffice files like (*.odt, *.ods, *.odp)? -
i want *.ods , *.odt files on website open in openoffice when clicked, not saved on desktop, or opened embedded in browser etc. depends on how configured each user, what's best mimetype , other settings achieve of time?
i know older *.doc documents enough:
header("content-type: application/msword")
;
i solution open office.
my /etc/mime.types
says it's:
application/vnd.oasis.opendocument.text
*.odt
application/vnd.oasis.opendocument.spreadsheet
*.ods
application/vnd.oasis.opendocument.presentation
*.odp
it makes sense, it's corporate standard (vnd), designed oasis organization, used different formats of opendocuments.
if don't want bother sending correct mime types, may use finfo
class you:
$finfo = new finfo(fileinfo_mime); header('content-type: ' . $finfo->file('/path/to/file'));
Comments
Post a Comment