Copy link to clipboard
Copied
We have an intranet site with a page that is controlled by an XML file. Right now the XML file is located on the web root. I wanted to see if I caould have the XML file on a mapped drive. It errors out with the path below.
<cfset CoolXmlFile = ExpandPath("Y:/COOP/Metwatch/modify/bk1.xml") />
<cffile action="read" file="#CoolXmlFile#" variable="input_xml" />
Here is the error. for some reason it puts a slash in....?
An error occurred when performing a file operation read on file C:\wwwroot\Layout\FrontPage\bk1\Y:\COOP\Metwatch\modify\bk1.xml. | |
The cause of this exception was: java.io.FileNotFoundException: C:\wwwroot\Layout\FrontPage\bk1\Y:\COOP\Metwatch\modify\bk1.xml (The filename, directory name, or volume label syntax is incorrect). |
Make sure the file permissions are right... You WILL need to switch CF to using a Domain Login in the service properties to get the UNC crap to work.
D.
Copy link to clipboard
Copied
Does the CF server have permissions to that file location?
How is the drive mapping created? If it's just via "map a network" in Windows explorer, that's specific to your Windows Explorer shell, which CF doesn't use, so it won't know about it. If it's done as a login script... CF will need to be logging with an account that runs that login script (if even service-logins run login scripts?)
You're better off using a UNC path. The CF server still needs permissions to see the remote resource though.
--
Adam
Copy link to clipboard
Copied
Alright I changed it to
<cfset MyXmlFile = ExpandPath("\\192.168.10.220\shared\COOP\Metwatch\sourceinfo.xml") />
Still it shows this error
An error occurred when performing a file operation read on file C:\wwwroot\192.168.0.220\shared\COOP\Metwatch\sourceinfo.xml. | |
The cause of this exception was: java.io.FileNotFoundException: C:\wwwroot\131.10.205.178\shared\COOP\Metwatch\sourceinfo.xml (The system cannot find the path specified). | |
Copy link to clipboard
Copied
Make sure the file permissions are right... You WILL need to switch CF to using a Domain Login in the service properties to get the UNC crap to work.
D.