Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Hello Team,
Since AEM (6.5 in my case) by default downloads DAM PDFs.
We added below lines and we can view PDFs upon clicking.
<LocationMatch "\.(?i:pdf)$">
ForceType application/pdf
Header set Content-Disposition inline
</LocationMatch>
PROBLEM:
We also have to give way to download as an option. so for that, created Servlet (Code Below) and set Content-Disposition as "attachment". When we try to access PDF using "docdown" selector directly from Publish Machine, It downloads.
where as from Dispatcher URL, It always show "inline" and It does not download, always open in view mode.
Code Below:
@SlingServletResourceTypes(resourceTypes = "dam:Asset", methods = HttpConstants.METHOD_GET, selectors = "docdown", extensions = "pdf")
@ServiceDescription("Download PDF Servlet")
public class DownloadPDFServlet extends SlingSafeMethodsServlet {
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
We fixed using below:
<LocationMatch "^((?!docdown).)*\.pdf$">
ForceType application/pdf
Header set Content-Disposition inline
</LocationMatch>
We fixed using below:
<LocationMatch "^((?!docdown).)*\.pdf$">
ForceType application/pdf
Header set Content-Disposition inline
</LocationMatch>
@arvind Tthank you for sharing the solution with the AEM community. This would help the community in posterity.
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas