Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Content Disposition on AEM as Cloud

Avatar

Community Advisor

I am trying to open the PDFs in browser instead of downloading the PDF.

So far I have configured the ContentDispositionFilter with the below properties and it works perfectly fine.

{
"sling.content.disposition.paths": "/content/*:application/pdf",
"sling.content.disposition.all.paths": "false"
}

When I check the same functionality on AEM as Cloud I see the below additional headers are added and the PDF is downloaded.

content-disposition:
attachment; filename="Z571_MPS130_01eA.pdf"; filename*=UTF-8''Z571_MPS130_01eA.pdf
 
Can anyone point out what am I missing here and where these additional headers are getting added?
 
Thanks!

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Asutosh_Jena_ ,

 

As per below link, Content disposition filter is not supported in AEMaaCS.

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/assets-cloud... 

 

kishorekumar14_0-1640689322346.png

 

So set the disposition setting in dispatcher config.

 

<LocationMatch "\.(?i:pdf)$">
  ForceType application/pdf
  Header set Content-Disposition inline
</LocationMatch>

 

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @Asutosh_Jena_ 
I would suggest to check the dispatcher and apache config here.

You can remove this headers from dispatcher also.

 

For cached file I am not sure if publihser would remove those headers.



Arun Patidar

Avatar

Correct answer by
Community Advisor

Hi @Asutosh_Jena_ ,

 

As per below link, Content disposition filter is not supported in AEMaaCS.

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/assets-cloud... 

 

kishorekumar14_0-1640689322346.png

 

So set the disposition setting in dispatcher config.

 

<LocationMatch "\.(?i:pdf)$">
  ForceType application/pdf
  Header set Content-Disposition inline
</LocationMatch>

 

Avatar

Community Advisor

@Kishore_Kumar_ Thanks for the response. I was looking for any type of OSGi config without updating anything on the dispatcher but it does not look like an option in AEM as Cloud Service anymore!

Avatar

Level 4

Update: sorry, my bad, I modified the available_vhost file and created a symlink to the enabled_vhost file, restarted dispatcher, then it started working!

Hi Kishore, can you pls let me know in which dispatcher file this should be added? I did it in the project file under /conf.d/enabled_vhosts/<project_publish>.vhost (which is included via another file) but it doesn't seem to work. So looking for some help here.

 

Note: I also did dispatcher restart and cleared dispatcher cache.

 

Thanks!

Avatar

Level 2

@Kishore_Kumar_  The above dispatcher header rule is not working if we add it in the project file /conf.d/enabled_vhosts/<project_publish>.vhost for the AEM as a Cloud Service project. Could you please confirm where this needs to be added.