开发者

Coldfusion: download PDF

开发者 https://www.devze.com 2022-12-30 03:26 出处:网络
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 be

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?


<cfheader> before <cfcontent>

you don't need <cflocation>.

http://tutorial217.easycfm.com/


<cfheader name="Content-Type" value="unknown">
<cfheader name="Content-Disposition" value="attachment; filename=FileName.jpg">
<cfcontent type="Application/Unknown" file="/http//downloads/FileName.jpg" deletefile="No">
0

精彩评论

暂无评论...
验证码 换一张
取 消