Resource icon

MetaMimeType: View PDF Attachments in-browser 0.2a

No permission to download

Mick West

Well-known member
Mick West submitted a new resource:

MetaMimeType Inline PDF Attachments - Alters the MIME type of .pdf and .txt files so they display in the browser

By default XenForo gives all non-image attachments the MIME type of '
application/octet-stream' - things means that attachments such as .pdf and .txt files will act like binary files, and not be opened by the browser (instead they will be downloaded, and you have to open the downloaded file).

MetaMimeType is a small patch to replace the MIME type on .pdf and .txt attachments files so they display correctly.

The types are set in MetaMimeType_ViewPublic_Attachment_View in
Read more about this resource...


Well-known member
It's better if you can make this:
     $mimeTypes = array(
                'pdf' => 'application/pdf',
                'txt' => 'text/plain',
As an admin option/settings so that we can add as many as we want easily.
Thanks for creating this. My users on iOS were having difficulties viewing PDF files.

This is working fine on 1.4 in case anyone is wondering.