Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Content-Disposition Header

Avatar

Level 3

I have some html stored under /etc/library/module/ 

when I access these files on AEM 6.2 directly on Server i.e. https://localhost:4502/etc/library/module/module.html

It download's the file instead of opening it in the browser.

Looked at the response header it shows Content-Disposition : attachment.

In 6.0 we have com.day.cq.dam.core.impl.servlet.SafeBinaryGetServlet to control this header.

However in 6.2 this component seems to have deprecated

Can anyone help me to understand how this content-disposition header be controlled in AEM 6.2? 

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Check if this works for you.

Apache Sling Content Disposition Filter (org.apache.sling.security.impl.ContentDispositionFilter)

View solution in original post

7 Replies

Avatar

Correct answer by
Level 10

Hi,

Check if this works for you.

Apache Sling Content Disposition Filter (org.apache.sling.security.impl.ContentDispositionFilter)

Avatar

Level 10

Add the path which you want to exclude in the above configuration

Avatar

Level 3

Thank you Lokesh..

Solution of adding an individual .html file works. However I have 20+ odd files which I'll need to add to this filter.

http://grepcode.com/file/repo1.maven.org/maven2/org.apache.sling/org.apache.sling.security/1.0.10/or...

looks like this filter does not allow regex patterns (*.html) 

just wondering if there is any alternative solution?

Avatar

Administrator

atulj26424737 wrote...

Thank you Lokesh..

Solution of adding an individual .html file works. However I have 20+ odd files which I'll need to add to this filter.

http://grepcode.com/file/repo1.maven.org/maven2/org.apache.sling/org.apache.sling.security/1.0.10/or...

looks like this filter does not allow regex patterns (*.html) 

just wondering if there is any alternative solution?

 

 

 

Hi,

As your primary question is answered, i would request you to please close this question and create new question for follow-up questions.

~kautuk 



Kautuk Sahni

Avatar

Level 1

just unchecking the Enable Content Disposition for all paths . Still File is getting downloaded

Avatar

Level 2

atulj26424737 Try adding this Configuration Biding: launchpad:resources/install/5/org.apache.sling.security-1.0.18.jar to Apache Sling Content Disposition Filter

Avatar

Level 2

priyajoshi

Remove the text/html form the Dam Safe Binary Filter osgi configuration