Download Pdf

Stephanie Clark asked on December 19, 2016 20:16

I am using a repeater / transformation to list literature. I would like the user to have the ability to just download the pdf without having to open the file and then save it. I have tried using the download attribute in the a href tag but only a few browsers support this.

Are there any other solutions for this situation?

Correct Answer

Jan Hermann answered on December 19, 2016 21:16

You can append following query string to your pdf link to achieve that:

?disposition=attachment

0 votesVote for this answer Unmark Correct answer

Recent Answers


Roman Hutnyk answered on December 19, 2016 21:01

I think actual behavior depends on browser - one might download it immediately meanwhile another will open it for preview. It is not Kentico related feature.

0 votesVote for this answer Mark as a Correct answer

Stephanie Clark answered on December 19, 2016 21:56

Thank you Jan, appending ?disposition=attachment worked.

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on December 22, 2016 12:13

Hi Stephanie, Instead of using query string parameter I would rather use HTML5 download attribute on an anchor link. This is recommended approach as PER HTML5 standards. Assuming that you are using transformations as you stated. The code will be like this <a href="{%DownloadFile%}" download="file.pdf">Download Your File</a>

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.