Keyword

how to view pdf attachments in new window?(instead of downloading)

  • aquib ali
  • aquib ali's Avatar Topic Author
  • Offline
  • New Member
More
14 years 1 month ago #87865 by aquib ali
how to view pdf attachments in new window?(instead of downloading) or add a separate button for viewing the attachment(mainly .pdf)...plz help..its really important :(thnx in advance

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #87866 by Marco Carrai
I have the same problem...
I can't find the solution.

:(

Please Log in or Create an account to join the conversation.

  • aquib ali
  • aquib ali's Avatar Topic Author
  • Offline
  • New Member
More
14 years 1 week ago #87867 by aquib ali
go to directory:
..\components\com_k2\templates\default
open: item.php
in div class="itemAttachmentsBlock"(line 374)
at the end of the block add the following code:

< ? php $view="http://localhost\aq\media\k2\attachments/".$attachment->title ;
$html='VIEW ATTACHMENT
'; echo $html;
? >

(if working on a local server..else mention your home directory instead of localhost)

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #87868 by Marco Carrai
...thanks, but it doesn't work for me.
It open the "save as" window

Any other clue ?

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #87869 by Jakub Jedynak
Use "Edocs - Embed Documents!" plugin.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #87870 by TOTHOMweb
In case anyone needs it, you can do it by editting (or better, overriding using K2 component templates) the file /components/com_k2/templates/<your template>/item.php

And after
Log in  or Create an account to join the conversation.