<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Content disposition not inline for pdf files without extesion</title>
  <link rel="self" href="https://liferay.dev/de/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121361574" />
  <subtitle>Content disposition not inline for pdf files without extesion</subtitle>
  <id>https://liferay.dev/de/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121361574</id>
  <updated>2026-04-25T17:29:05Z</updated>
  <dc:date>2026-04-25T17:29:05Z</dc:date>
  <entry>
    <title>Content disposition not inline for pdf files without extesion</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121361573" />
    <author>
      <name>Alessandro Candini</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121361573</id>
    <updated>2022-02-14T11:03:21Z</updated>
    <published>2022-02-14T11:03:19Z</published>
    <summary type="html">&lt;p&gt;Hi everyone, I've the following problem.&lt;/p&gt;
&lt;p&gt;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 &lt;strong&gt;Content-Disposition&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;My problem is that files with &amp;quot;.pdf&amp;quot; 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.&lt;/p&gt;
&lt;p&gt;We did not have customized the relative property, so we use the default:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;mime.types.content.disposition.inline=flv,gif,jpg,pdf,png,wmv&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;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: &lt;em&gt;
    &lt;strong&gt;test-pdf-with-extension.pdf&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;
    &lt;strong&gt;test-pdf-without-extension &lt;/strong&gt;&lt;/em&gt;​​​.&lt;/p&gt;
&lt;p&gt;If I go to the Documents and Media file information of the file,
  copy-pasting the web URL inside &amp;quot;URL of latest version&amp;quot;
  (which is the one we use in our frontend interface) in the URL adress
  bar of my browser, opens a tab for the &lt;em&gt;
    &lt;strong&gt;test-pdf-with-extension.pdf&lt;/strong&gt;&lt;/em&gt; but opens a
  download popup for &lt;em&gt;
    &lt;strong&gt;test-pdf-without-extension &lt;/strong&gt;&lt;/em&gt;​​​​​.&lt;/p&gt;
&lt;p&gt;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?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;</summary>
    <dc:creator>Alessandro Candini</dc:creator>
    <dc:date>2022-02-14T11:03:19Z</dc:date>
  </entry>
</feed>
