Content-Disposition Header | Community
Skip to main content
Level 3
January 10, 2017
Solved

Content-Disposition Header

  • January 10, 2017
  • 7 replies
  • 6586 views

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.
Best answer by Lokesh_Shivalingaiah

Hi,

Check if this works for you.

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

7 replies

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
January 10, 2017

Hi,

Check if this works for you.

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

Lokesh_Shivalingaiah
Level 10
January 10, 2017

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

AlthamAuthor
Level 3
January 11, 2017

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?

kautuk_sahni
Community Manager
Community Manager
January 11, 2017

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 

Kautuk Sahni
July 30, 2018

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

Level 2
September 20, 2018

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

Level 2
September 20, 2018

priyajoshi

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