Sean,
Thanks for your reply - in regards to the "FileExists()" - I had set that up as a quick test and received the same error (essentially) as my primary code that is generating the eror. Below is the actual code that generates the error - along with the full output of the error message below;
The code calls another file to actually "push" the PDF I am trying to open - hopefully the code all makes sense. The CFSET code calculates the file name as files are stored in different sub-directories. This code has worked well for over a year.
As for the 500 error - I suspect that is a permissions issue - that folder is not publicly accessible - but it is to the coldfusion user account - and thus it serves it up.
Code:
------- Both the primary module and the called module ---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<!--- This file calls the push file routine and passes along the parameters. It also acts as the "shell" to open the new window.
First we have to check and make sure that the random number matches up with the job number. --->
<cfquery name="qRandom" datasource="BPOffice">
SELECT OrderNum, Random
FROM JobOrder_Data.db
WHERE (OrderNum = #URL.fn#) AND (Random = #URL.rnd#)
</cfquery>
<body>
<cfif qRandom.RecordCount EQ 1>
<cfset variables.MIMEType="application/pdf">
<cfset variables.FileName = "http://www.mybp-graphics.com/serverpdfs/" & "#(Int(URL.fn/10000)*10)#" & "kPDFs" & "#URL.fn#" & ".pdf">
<cfset variables.Displaytype="inline">
<cf_pushfile
FileName=#variables.FileName#
MIMEType=#variables.MIMEType#
DisplayType=#variables.DisplayType#>
<cfelse>
Error - no file found.
</cfif>
</body>
</html>
======= Now the CF_PUSHFILE code ======
<cfset variables.FileToPush=attributes.FileName>
<cfheader
name="content-disposition"
value="#attributes.DisplayType#; filename=#attributes.FileName#">
<cfcontent
type="#attributes.MIMEType#"
file=#variables.FileToPush#>
==========END OF PUSHFILE CODE============
-----End of Code
Error:
An error occurred when performing a file operation exists on file /serverpdfs/130kPDFs/137623.pdf. | |||||||||
The cause of this exception was: org.apache.commons.vfs.FileSystemException: Could not determine the type of file "http://www.mybp-graphics.com/serverpdfs/130kPDFs/137623.pdf".. | |||||||||
The error occurred in C:/Inetpub/wwwroot/Paradox/open_pdf.cfm: line 38 | |||||||||
36 : <cfheader name="Content-Disposition" value="inline; filename=#variables.ShortName#"> 37 : <cfheader name="Expires" value="#Now()#"> 38 : <cfcontent type="application/pdf" file="#variables.FileName#"> 39 : 40 : | |||||||||
Resources:
| |||||||||
|
Stack Trace |
at cfopen_pdf2ecfm1312221362.runPage(C:/Inetpub/wwwroot/Paradox/open_pdf .cfm:38) at cfopen_pdf2ecfm1312221362.runPage(C:/Inetpub/wwwroot/Paradox/open_pdf .cfm:38) org.apache.commons.vfs.FileSystemException: Could not determine the type of file "http://www.mybp-graphics.com/serverpdfs/130kPDFs/137623.pdf". at org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFil eObject.java:1305) at org.apache.commons.vfs.provider.AbstractFileObject.getType(AbstractFi leObject.java:412) at org.apache.commons.vfs.provider.AbstractFileObject.exists(AbstractFil eObject.java:402) at coldfusion.vfs.VFile.exists(VFile.java:230) at coldfusion.tagext.net.ContentTag.doStartTag(ContentTag.java:178) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfopen_pdf2ecfm1312221362.runPage(C:\Inetpub\wwwroot\Paradox\open_pdf .cfm:38) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381 ) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.ja va:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:94) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePers istenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:200) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:8 9) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringS ervletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46 ) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java: 286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java: 543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.ja va:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo l.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j ava:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool. java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) Caused by: org.apache.commons.vfs.FileSystemException: HEAD method failed for "http://www.mybp-graphics.com/serverpdfs/130kPDFs/137623.pdf". at org.apache.commons.vfs.provider.http.HttpFileObject.doGetType(HttpFil eObject.java:96) at org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFil eObject.java:1296) ... 36 more |
----
As you'll notice I am getting the same "org.apache.commons.vfs" error as before.
Any further thoughts would be greatly appreciated.
Thanks
Curt