Hosting Static HTML in the JCR

Avatar

Avatar

SmashTheGoat

Avatar

SmashTheGoat

SmashTheGoat

23-08-2016

Hi, 

I've got a use case where I need to store and serve static html, js, css, images, flash videos, and etc from the JCR. 

The only suggestions I could find on how to do this come from this article. http://blogs.adobe.com/dekesmith/2012/05/22/place-simple-html-and-image-files-online-with-crx-and-cq...

I've tried all methods of uploading my static content as described in the article and have been able to consistently upload my static content to the JCR. However, the problem that I'm facing is actually trying to render the content. 

In AEM 6.2, when I attempt to hit the static content, such as: /content/some-site/some-static-page.html, it is treated like a binary download. It does the same for all the other filetypes that I've uploaded. Instead of trying to render them, it simply downloads them to my computer.

I noticed that the article was written in 2012, so I tried this on an older version of AEM, specifically 5.6.1, and I was successfully able to render the content within the browser.

I think it has something to do with the one of the rendering servlets, but I'm not sure. Any help is greatly appreciated. 

View Entire Topic

Avatar

Avatar

sawan051

Avatar

sawan051

sawan051

28-03-2019

I also had similar requirement and have used the process explained by @francisco.ribeiro .

In case you are hosting the HTML files in DAM, you can disable it by changing an OSGI Config:

Dam Safe Binary Filter (com.day.cq.dam.core.impl.servlet.DamContentDispositionFilter), remove text/html from Blacklisted Mime Types

It worked all good till 6.2, now we are upgrading to 6.4 and again now HTML files have started downloading, instead of rendering in browser. Is Dam Safe Binary filter deprecated in 6.4?

Any suggestion, how it can be done in 6.4, is there a way to enable same from content/dam?