Quick question, what needs to be changed to serve html page in DAM as a text/html and not application/save...
Thanks,
Peter
Solved! Go to Solution.
Views
Replies
Total Likes
One of my client had similar requirements and after some analysis(mentioned below) I could render the html from /content/dam path.
So a DAM Asset is served by the BinaryProviderServlet and after doing its own stuff it dispatches the request to another servlet called SafeBinaryGetServlet which will either render the resource or ask the browser to save it based on the mime:type of the resource is in black list or not, since the “text/html” is registered as a blacklist mime type by the SafeBinaryGetServlet. And for that black list it sets a “content-disposition:attachment” header with attachment as an option, its a direction to the browser to download the file and not render it. Hope this is clear till now.
Note: Make sure you do impact analysis of the change I am suggesting below.
Run this curl command to have the configuration removed from OSGI web console.
curl -u admin:admin -X POST 'http://localhost:4502/system/console/configMgr/com.day.cq.dam.core.impl.servlet.SafeBinaryGetServlet...'
Or
Directly go to AEM Web console - http://localhost:4502/system/console/configMgr/com.day.cq.dam.core.impl.servlet.SafeBinaryGetServlet
and remove the text/html entry from config, save it.
Also, the better place to put such artefacts is /content/campaign
That way the above mentioned restrictions will not come into picture and the content will be served properly without any explicit changes.
Thanks,
Rakesh
Views
Replies
Total Likes
Can you please describe what you are tying to do? If you want to serve up an HTML page that shows DAM assets - why not simply write a component that uses HTML and app logic to get DAM assets and display in the HTML?
Views
Replies
Total Likes
Also, the better place to put such artefacts is /content/campaign
That way the above mentioned restrictions will not come into picture and the content will be served properly.
Views
Replies
Total Likes
One of my client had similar requirements and after some analysis(mentioned below) I could render the html from /content/dam path.
So a DAM Asset is served by the BinaryProviderServlet and after doing its own stuff it dispatches the request to another servlet called SafeBinaryGetServlet which will either render the resource or ask the browser to save it based on the mime:type of the resource is in black list or not, since the “text/html” is registered as a blacklist mime type by the SafeBinaryGetServlet. And for that black list it sets a “content-disposition:attachment” header with attachment as an option, its a direction to the browser to download the file and not render it. Hope this is clear till now.
Note: Make sure you do impact analysis of the change I am suggesting below.
Run this curl command to have the configuration removed from OSGI web console.
curl -u admin:admin -X POST 'http://localhost:4502/system/console/configMgr/com.day.cq.dam.core.impl.servlet.SafeBinaryGetServlet...'
Or
Directly go to AEM Web console - http://localhost:4502/system/console/configMgr/com.day.cq.dam.core.impl.servlet.SafeBinaryGetServlet
and remove the text/html entry from config, save it.
Also, the better place to put such artefacts is /content/campaign
That way the above mentioned restrictions will not come into picture and the content will be served properly without any explicit changes.
Thanks,
Rakesh
Views
Replies
Total Likes
Does this work in AEMaaCS as well?
Views
Replies
Total Likes
Hi Scott,
That's exactly what was offered from us. However, team that wanted this featured required a 'simple' solution to store files and get benefits of the CDN network that is setup for the CQ5 infrastructure(.e.g. custom cache busting and other features that come in hand when content is stored in DAM)
Peter
Views
Replies
Total Likes
Perfect answer, thank you for your help Mr Kumar !
Peter
Views
Replies
Total Likes
Hi All,
Does this work in AEMaaCS as well?
I have done the changes but still i am not able to see the html content on dam asset.
removed text/html from this config .
http://localhost:4502/assetdetails.html/content/dam/test.html
reproduce:
1. create .html file add normal html content.
2. upload into dam post processing click on the asset.
3. it is opening like a bove screenshot.
currenly we are using aem as cloud service.
thanks in advance.
Views
Replies
Total Likes