How to open html file inline in AEM assets than downloading it? | Community
Skip to main content
Adobe Champion
August 30, 2022

How to open html file inline in AEM assets than downloading it?

  • August 30, 2022
  • 4 replies
  • 6055 views

I have a html file which is residing in DAM which is the default page to be displayed from Akamai incase of an error. We don't have sites license and hence this html residing in DAM.

I have the html file now available in DAM like an asset. But when I try to access it through the dispatcher URL, it gets downloaded as a file than opening the page inline in the browser. How can i fix this issue and open that inline instead of downloading?

I tried https://helpx.adobe.com/mt/experience-manager/kb/HTML-file-stored-in-CRX-does-not-open-in-Browser-instead-is-getting-downloaded.html and https://stackoverflow.com/questions/42447453/is-there-a-way-to-upload-html-pages-into-aem-dam 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

muskaanchandwani
Adobe Employee
Adobe Employee
August 30, 2022

@p_v_nair Are you able to view the HTML file in the Browser when you access the AEM instance directly (without the Dispatcher)?

Have you configured the headers section (added "Content-Disposition") in the Dispatcher Configuration as per [1]?

[1]  https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html?lang=en#caching-http-response-headers

P_V_NairAdobe ChampionAuthor
Adobe Champion
August 30, 2022

@muskaanchandwani I have verified direct publish instance and there too it is getting downloaded  than opening inline. [1] is already covered in our dispatcher, I just verified. So , i think we need to fix this first in direct publish.

P_V_NairAdobe ChampionAuthor
Adobe Champion
August 30, 2022
Adobe Employee
September 1, 2022

I don't think you can render the asset directly. You would need a renderer that can use this asset URL to render.

P_V_NairAdobe ChampionAuthor
Adobe Champion
September 1, 2022

@digarg17  Do you mean to say a renderer component using Sites? We don't have sites license and not planning to create any page component to do this. I have seen blogs as in the links above seeing users have done this by opening html pages from assets inline. But that same configuration change is not working for me.

Nitin_laad
Community Advisor
Community Advisor
September 6, 2022

Hi @p_v_nair Since AEM DAM is an asset container, html can be uploaded and used as an asset in other html, but html cannot be opened directly from DAM.

P_V_NairAdobe ChampionAuthor
Adobe Champion
September 6, 2022

@nitin_laad  Thank you for your reply. I have seen in some posts - Is there a way to upload html pages into AEM DAM - Stack Overflow

and

HTML file stored in CRX does not open in Browser, instead, it is getting downloaded | AEM (adobe.com)

that this is possible by changing the configuration,  Dam Safe Binary Filter(com.day.cq.dam.core.impl.servlet.DamContentDispositionFilter . 

But , I tried the same in 6.5 and it doesn't work. 

Nitin_laad
Community Advisor
Community Advisor
September 6, 2022

Thanks @nitin_laad  We are not into cloud as a service yet. We are on managed services. I can definitely check with Adobe before we go for it.

Can you also help me locate the dispatcher config file should we incorporate this change? Is it the farm file?


It should be httpd.conf

 

Level 2
September 28, 2022

Hello @p_v_nair 

 

I have same problem, I want to load public image inline and always is downloaded. Have you resolved this problem?

Regards.

P_V_NairAdobe ChampionAuthor
Adobe Champion
September 28, 2022

@ancara  Unfortunately no. None of the recommendations worked for me and at last we changed the solution to create a simple page component and create a error page in sites to add the same html in there.

Level 2
October 27, 2022

Hi, we have resolved problem with this configuration on dispatcher:

 

<LocationMatch "^/content/dam/.*\.(?i:jpe?g|gif|js|mov|mp4|png|svg|txt|zip|ico|webp|pdf)$">
Header unset "Content-Disposition"
Header set Content-Disposition inline
</LocationMatch>

 

Our content DAM is now loaded on browser. 

 

Regards.