Using cfcontent to pull pdf's from file
Hello,
I have searched the forums extensively and still have not found a solution. What I am trying to achieve is simple, but am having problems getting it to work.
I want to pass a dynamic url string from a web mapping application to a cold fusion page that then opens the pdf file on the users browser. This is an example of the url that will be passed to this page, and based on what feature the user selects, subdir and page_id will be dynamic:
http://localhost/displayImage.cfm?subdir=60&page_id=3807444
Here is what I have so far for displayImage.cfm,it is just a start, I know I need more, possibly cfheader content? When I run this code I get an error saying the file cannot be found.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<cfquery name="Surveys" datasource="sire" dbtype="odbc">
select *
from slco_sire.dbo.surveys_doc INNER JOIN slco_sire.dbo.surveys_page
ON slco_sire.dbo.surveys_doc.doc_id = slco_sire.dbo.surveys_page.doc_id
</cfquery>
<cfset picture="#url.page_id#">
<cfset sub="#url.subdir#">
<cfcontent file="\\path\to\file\#sub#\#picture#" type="application/pdf" reset="yes">
</body>
</html>
Any help would be greatly appreciate, I am stuck. ![]()
