Expand my Community achievements bar.

SOLVED

Add additional header field

Avatar

Level 3

How to add additional response header field? For example the request looks like this:

http://example.com/content/dam/examples/ex.pdf?

I want to add: Content-Disposition: attachment It will force a browser to download file, not showing a file in a browser

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

If you are using latest AEM version & want this option for all PDF. You can backlist at [1] & which forces the file to download.

[1]  http://<host>:<port>/system/console/configMgr/com.day.cq.dam.core.impl.servlet.SafeBinaryGetServlet

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

If you are using latest AEM version & want this option for all PDF. You can backlist at [1] & which forces the file to download.

[1]  http://<host>:<port>/system/console/configMgr/com.day.cq.dam.core.impl.servlet.SafeBinaryGetServlet

Avatar

Level 7

Hiya,
i would try to set that in the dispatcher for the pdf extensions. Something in the lines of:
 

<IfModule mod_headers.c> <FilesMatch "\.(PDF|pdf)$"> //... other info Header set Content-Disposition "attachment" //... other info </FilesMatch> </IfModule>

Hope that helps

/Johan