This works for me:
<cfheader name="content-disposition"
<cfcontent type="application/pdf" file="#filepath#" reset="yes">
Also, make sure your PDF files actually end with a PDF extension.
As far as saving them in the database, although it is possible. It is not recommended. The file system of your webserver is much faster at retrieving files than making a call do a database server. Also, you can not output binary variables directly from Cold Fusion. You have to save them as a local file using CFFILE then you use CFCONTENT to send them to the browser. So, since you are sticking the file on the hard drive of the web server anyways, why not just keep it there in the first place. Hope this helps.
Main Topics
Browse All Topics





by: ftvcsPosted on 2004-03-29 at 01:48:29ID: 10702629
I'd try something like this:
<cfif CGI.HTTP_REFERER eq"frompage.cfm">
<cfcontent type = "application/pdf"
file = "c:\files\files1.pdf"> <!--- path not accesible from internet--->
</cfif>
If you have questions, don't hesitate to ask.
Tom