Content disposition not inline for pdf files without extesion

thumbnail
Alessandro Candini, modified 3 Years ago. Regular Member Posts: 130 Join Date: 10/17/15 Recent Posts

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.