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
Code:
...

Read more about this resource...
 
It's better if you can make this:
Code:
     $mimeTypes = array(
                'pdf' => 'application/pdf',
                'txt' => 'text/plain',
        );

As an admin option/settings so that we can add as many as we want easily.
 
It's better if you can make this:
Code:
     $mimeTypes = array(
                'pdf' => 'application/pdf',
                'txt' => 'text/plain',
        );

As an admin option/settings so that we can add as many as we want easily.

I know :) I only spent like 20 minutes on it :) I'll give it a bash.
 
  • Like
Reactions: rdn
And also, Can you make use of the file's file name as Title on browser tab?
Same as images.
 
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.
 
Top Bottom