Hi everyone,
We have came across an unexpected behavior when requesting a thumbnail image for a content fragment.
Where instead of displaying the thumbnail image in the browser its being downloaded. Upon further investigation, I believe this is caused by the header present in the response "Content-Disposition: attachment"
Which is asking the browser to download the image instead of displaying as inline.
Is there any other way how to get the image path, which can be used as reference?
Is there a settings which could be changed to remove this header without impacting the platform security?
The current path example for the thumbnail image:
http://localhost:4502/content/dam/test/content-fragment/cf_sample1/_jcr_content/thumbnail.png
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @ZdenekK ,
There are two ways to fix this. You can write a rule at dispatcher rule so that this header will be updated from attachment to inline like this.
<LocationMatch "\.(?i:txt)|(?i:pdf)|(?i:xml)|(?i:png)$">. -->add all your extensions here
Header set Content-Disposition inline
</LocationMatch>
The other approach is to put the configuration in Apache Sling Content Disposition Filter which is an OOTB service in AEM. Please refer to this: https://aem4beginner.blogspot.com/aem-pdf-is-getting-downloaded-instead
Hi @ZdenekK ,
There are two ways to fix this. You can write a rule at dispatcher rule so that this header will be updated from attachment to inline like this.
<LocationMatch "\.(?i:txt)|(?i:pdf)|(?i:xml)|(?i:png)$">. -->add all your extensions here
Header set Content-Disposition inline
</LocationMatch>
The other approach is to put the configuration in Apache Sling Content Disposition Filter which is an OOTB service in AEM. Please refer to this: https://aem4beginner.blogspot.com/aem-pdf-is-getting-downloaded-instead
Thank you @Anish-Sinha for the quick reply
Views
Likes
Replies