Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Content disposition not inline for pdf files without extesion
Hi everyone, I've the following problem.
I'm using Liferay DXP 7.3.10 SP3 and I need to open pdf files inside browser in a new tab, so I need to make use of the HTTP Header Content-Disposition.
My problem is that files with ".pdf" extension in their filename are correctly opened in a new tab (Content-Disposition:inline), the ones without it are instead downloaded (Content-Disposition:attachment), unlike in Liferay 6.2 EE where both of them were opened in a new tab.
We did not have customized the relative property, so we use the default:
mime.types.content.disposition.inline=flv,gif,jpg,pdf,png,wmv
I've made the following test: I've produced 2 pdf files, the first one with the correct extension .pdf and the second one without it: test-pdf-with-extension.pdf and test-pdf-without-extension .
If I go to the Documents and Media file information of the file, copy-pasting the web URL inside "URL of latest version" (which is the one we use in our frontend interface) in the URL adress bar of my browser, opens a tab for the test-pdf-with-extension.pdf but opens a download popup for test-pdf-without-extension .
We could tell editors to upload their files with the .pdf extension to avoid this issue (we'll certainly do), but the problems remains for hundreds of files migrated from 6.2 that has no pdf extension in their filename...is there a way to manage them?
Thank you.
Powered by Liferay™