Attachment view instead of download?

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Attachment view instead of download?

Post by skej »

Is there a way to have attachments open in the browser instead of download? For instance a pdf attachment. I've tested this functionality on other support sites such as the one HERE
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment view instead of download?

Post by Thorsten »

Hi,

change this line

https://github.com/thorsten/phpMyFAQ/bl ... nt.php#L69

to

Code: Select all

$attachment->rawOut('inline');
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

Didn't seem to make any difference, I tried deleting the attachment and uploading a different one (still a .pdf) and when clicked it downloads instead of open in browser window.
PHP version is 5.4.26 on IIS 7
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment view instead of download?

Post by Thorsten »

Hi,

which browser do you use? Firefox or Chrome always open PDFs inline with their builtin viewer...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

Thorsten wrote:Hi,

which browser do you use? Firefox or Chrome always open PDFs inline with their builtin viewer...

bye
Thorsten
Chrome
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

I tested it out on the live demo which produced the same results here.
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

Any other ideas?
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

Same thing for image attachments, they download instead of open in the browser.
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment view instead of download?

Post by Thorsten »

Hi,

do you use any special addons?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

I do not, everything is strait out of the box.
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

Unfortunately this is the only thing standing in the way of me using phpMyFAQ. :(
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment view instead of download?

Post by Thorsten »

Hi,

did you changed the code as I mentioned in my first reply?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

Hey Thorsten, thanks for sticking with me.

Yeah I attempted the change you suggested but it didn't seem to work.
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment view instead of download?

Post by Thorsten »

Hi,

can I check it in your FAQ?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
skej
Posts: 10
Joined: Mon Jul 28, 2014 3:12 pm

Re: Attachment view instead of download?

Post by skej »

No I'm afraid it is setup behind a company firewall.
Post Reply