Coldfusion: download PDF

Posted by dmr on Stack Overflow See other posts from Stack Overflow or by dmr
Published on 2010-05-11T20:33:25Z Indexed on 2010/05/18 3:10 UTC
Read the original article Hit count: 367

Filed under:
|
|
|

I have a URL that opens a PDF:

<cfoutput>http://myUrl.cfm?params=#many#<cfoutput>

I would like to enable my users to download that PDF instead of having it open in the browser. I've been trying the following, and it isn't working:

<cfoutput>    
<cfcontent type="application/pdf" file="http://myUrl.cfm?params=#many#"/> 
<cfheader name="content-diposition" value="attachment; filename='http://myUrl.cfm?params=#many#'">
<cflocation url= "http://myUrl.cfm?params=#many#"/>
</cfoutput>

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about coldfusion

Related posts about cfml