Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
sangeeth k
In navigation link I need to open PDF directly in browser
July 20, 2012 9:59 PM
Answer

sangeeth k

Rank: Regular Member

Posts: 114

Join Date: April 22, 2012

Recent Posts

Hi all,

I am trying to open PDF file directly in browser,

what i did First i uploaded document in Document library and I get the path like this
1/c/document_library/get_file?uuid=847aa31f-f639-4ca1-a6c2-8e7600bc23d6&groupId=10157


Here issue is its opening as a optional formate open save

I need to open onclick PDF directly in browser....

can any one help in this issue..

Thanks
Hitoshi Ozawa
RE: In navigation link I need to open PDF directly in browser
July 20, 2012 10:10 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

What's the problem? Just set the link to point to the url of the pdf file in the document library. You may need to setup your web browser to open pdf files.
sangeeth k
RE: In navigation link I need to open PDF directly in browser
July 20, 2012 10:34 PM
Answer

sangeeth k

Rank: Regular Member

Posts: 114

Join Date: April 22, 2012

Recent Posts

hitoshi

after linking that URL I am getting the popup box with open save options, But i need to open PDF directly in browser.
Shinn Lok
RE: In navigation link I need to open PDF directly in browser
July 20, 2012 11:05 PM
Answer

Shinn Lok

LIFERAY STAFF

Rank: Junior Member

Posts: 65

Join Date: January 14, 2011

Recent Posts

1    #
2    # Input a list of comma delimited extensions for which the content
3    # disposition header has to be set to "inline".
4    #
5    mime.types.content.disposition.inline=flv,gif,jpg,pdf,png,swf,wmv

The portal.property should make the content disposition inline instead of attachment so that it will try to open the file in your browser before it forces a download. Like Hitoshi said, it might be a configuration with your browser.
sangeeth k
RE: In navigation link I need to open PDF directly in browser
July 20, 2012 11:14 PM
Answer

sangeeth k

Rank: Regular Member

Posts: 114

Join Date: April 22, 2012

Recent Posts

Hi Shinn Lok,

I added properties in portal-ext.proeprties
1mime.types.content.disposition.inline=flv,gif,jpg,pdf,png,swf,wmv


But still I am getting Popup box

this is my link of PDF file

1/c/document_library/get_file?uuid=847aa31f-f639-4ca1-a6c2-8e7600bc23d6&groupId=10157


can i missing any thing....
Shinn Lok
RE: In navigation link I need to open PDF directly in browser
July 20, 2012 11:44 PM
Answer

Shinn Lok

LIFERAY STAFF

Rank: Junior Member

Posts: 65

Join Date: January 14, 2011

Recent Posts

Those are the default properties. The question is whether or not your browser is properly configured to open PDFs. You can test this by going to

http://www.liferay.com/documentation/liferay-portal/6.0/development

and clicking on the PDF PDF near the right hand side. If it does not open like how you expect your Liferay to, it confirms that it is your browser/PDF reader's settings.
sangeeth k
RE: In navigation link I need to open PDF directly in browser
July 20, 2012 11:56 PM
Answer

sangeeth k

Rank: Regular Member

Posts: 114

Join Date: April 22, 2012

Recent Posts

Hi

liferay link PDF is opening in my browser... so no browser issue....

In general webcontent portlet i am attaching that link its opening for that webcontent portlet.

But my scenario is, In theme navigation.vm file I have a link I am attaching that link like below.......

1<li><a href="/c/document_library/get_file?uuid=2cee54e3-3bbc-4d77-a060-5308892cdbdf&groupId=10157">Current Month</a></li>


and i added properties like you said........

But still i am getting POPUP

Thanks for reply.....
Hitoshi Ozawa
RE: In navigation link I need to open PDF directly in browser
July 21, 2012 1:11 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Which web browser and version are you using? Can you try with IE 8?
Pradeep Sharma
RE: In navigation link I need to open PDF directly in browser
February 26, 2013 11:25 AM
Answer

Pradeep Sharma

Rank: Junior Member

Posts: 47

Join Date: September 6, 2011

Recent Posts

Liferay is not compatible with IE for PDF or Excel doc rendering or downloading. Other browser works fine.
Rafael Lluis
RE: In navigation link I need to open PDF directly in browser
September 10, 2013 1:25 AM
Answer

Rafael Lluis

Rank: Junior Member

Posts: 29

Join Date: October 15, 2012

Recent Posts

sangeeth k:
Hi

liferay link PDF is opening in my browser... so no browser issue....

In general webcontent portlet i am attaching that link its opening for that webcontent portlet.

But my scenario is, In theme navigation.vm file I have a link I am attaching that link like below.......

1<li><a href="/c/document_library/get_file?uuid=2cee54e3-3bbc-4d77-a060-5308892cdbdf&groupId=10157">Current Month</a></li>


and i added properties like you said........

But still i am getting POPUP

Thanks for reply.....



What I have confirmed more or less is:

1. If you use get_file and the uuid in the link (https://xxx.xx/c/document_library/get_file?uuid=cf8b4745-c55c-41b8-94d0-59ac0edebf4e&groupId=10124) Liferay offers the PDF like an attachment showing up a pop up window with the options Open, Save, Save as

2. If you use a link based on the name of the file (which is the link that the control panel uses or the link that WYSIWYG editor generates) (https://xxx.xx/documents/10124/12870/20130910100138_manual+JSF) Liferay opens the PDF directly

I am using IE9 in both cases

So ¿what kind of URL to point to a file does Liferay recommends?

Thank you