コミュニティアチーブメントバーを展開する。

The first preview of our new Community upgrade is live - check it out now.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

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 受け入れられたソリューション

Avatar

正解者
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

元の投稿で解決策を見る

2 返信

Avatar

正解者
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