Skip to main content
January 12, 2010
Answered

create pdf and force download it

  • January 12, 2010
  • 1 reply
  • 5151 views

HI:

I create pdf in a realtime using <cfdocument format="pdf"> but when the user click on the link to view it, it open as browser. Can we somehow make this download instead? so we get prompt for "save as" download.

- A

This topic has been closed for replies.
Correct answer BKBK
create pdf and force download it

<cfheader name="Content-Disposition" value="attachment; filename=myDoc.pdf">

<cfcontent type="application/pdf">

<cfdocument format="PDF">

Some text.

</cfdocument>

1 reply

BKBK
BKBKCorrect answer
Community Expert
January 12, 2010
create pdf and force download it

<cfheader name="Content-Disposition" value="attachment; filename=myDoc.pdf">

<cfcontent type="application/pdf">

<cfdocument format="PDF">

Some text.

</cfdocument>

January 13, 2010

It worked! Thank you so much BKBK.

- A

BKBK
Community Expert
January 13, 2010

OK. Good luck.