attachment shown in browser

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
rioz
Posts: 8
Joined: Thu Dec 11, 2014 7:59 am

attachment shown in browser

Post by rioz »

Hi,

In default, attachment will be downloaded. I follow the link below to set the attachment open in browser instead of download but failed. May I know any clue to make it works?

phpmyfaq version: 2.8.19
OS: centos
browser: chrome

viewtopic.php?f=2&t=16504&p=44378&hilit ... iew#p44378

Thanks,
newbie
rioz
Posts: 8
Joined: Thu Dec 11, 2014 7:59 am

Re: attachment shown in browser

Post by rioz »

From the code, attachment will shown as "index.php?action=attachment&id=3" without any mime_type information which browser can't determine what kind of attachment it is. Is it the reason why browser will only download no matter what attachment it is? Anyway to fix it?

Thanks.
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: attachment shown in browser

Post by Thorsten »

Hi,

PDFs will be shown inline for me on OS X.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
rioz
Posts: 8
Joined: Thu Dec 11, 2014 7:59 am

Re: attachment shown in browser

Post by rioz »

Hi,

All type of attachment, even image, will be downloaded instead of viewed in browser in Windows environment. Do you have any idea?

Thanks,
rioz
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: attachment shown in browser

Post by Thorsten »

Hi,

re-checked the code, the attachments are not returned inline. But it can be done, open attachment.php in the root folder, go to line 85 () and change the code from

Code: Select all

        $attachment->rawOut();
to

Code: Select all

        $attachment->rawOut(true, 'inline');
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
rioz
Posts: 8
Joined: Thu Dec 11, 2014 7:59 am

Re: attachment shown in browser

Post by rioz »

Hi,

It works. Thanks,

rioz
Post Reply