Expand my Community achievements bar.

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

Avatar

Level 2

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 

1 Reply

Avatar

Administrator

@pragathiks Is this Question related to AEM? 



Kautuk Sahni