Regarding setting content-disposition header with current date and time for pdf file | Community
Skip to main content
Level 2
November 6, 2023

Regarding setting content-disposition header with current date and time for pdf file

  • November 6, 2023
  • 1 reply
  • 547 views

In vhost file  content-disposition inline which needs to changed to content-disposition attachment along with below changes..

 

suppose url is https://demo?refid=123

then  it should display file name = refid value + current date 

 

ex - file downloaded as 123-2023-11-06.pdf

 

if changed vhost file as below 

<FilesMatch "\.pdf$">
SetEnvIf Request_URI ".*\/(\d+)\/.*\.pdf$" refid=$1
Header set "Content-Disposition" "attachment; filename=%{refid}-%{TIME_YEAR}-%{TIME_MONTH}-%{TIME_DAY}.pdf"
</FilesMatch>

 

which is generating error as unexpected formate % - ...can any one please help 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

kautuk_sahni
Community Manager
Community Manager
December 5, 2023

@pragathiks Is this Question related to AEM? 

Kautuk Sahni