Content-Disposition Header | Community
Skip to main content
Level 3
Jan 10, 2017 9:24 PM UTC
Solved

Content-Disposition Header

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? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Jan 10, 2017 10:37 PM UTC

Hi,

Check if this works for you.

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

7 replies

Level 2
Sep 20, 2018 3:03 PM UTC

priyajoshi

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

Translate
Level 2
Sep 20, 2018 3:00 PM UTC

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

Translate
New Participant
Jul 30, 2018 7:37 AM UTC

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

Translate
kautuk_sahni
Employee
Jan 11, 2017 8:44 AM UTC

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/org/apache/sling/security/impl/ContentDispositionFilter.java

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 

Translate
Kautuk Sahni
AlthamAuthor
Level 3
Jan 11, 2017 1:24 AM UTC

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/org/apache/sling/security/impl/ContentDispositionFilter.java

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

just wondering if there is any alternative solution?

Translate
Lokesh_Shivalingaiah
Level 10
Jan 10, 2017 10:38 PM UTC

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

Translate
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Jan 10, 2017 10:37 PM UTC

Hi,

Check if this works for you.

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

Translate