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 » Thu Jan 15, 2015 8:07 am

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 » Thu Jan 15, 2015 10:14 am

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: 14794
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: attachment shown in browser

Post by Thorsten » Thu Jan 15, 2015 11:01 am

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 » Mon Jan 19, 2015 3:58 am

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: 14794
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: attachment shown in browser

Post by Thorsten » Sat Jan 24, 2015 8:28 am

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 » Wed Feb 04, 2015 8:01 am

Hi,

It works. Thanks,

rioz

Post Reply