Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ExpandPath to a mapped drive question

New Here ,
Feb 26, 2010 Feb 26, 2010

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).

787
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Feb 26, 2010 Feb 26, 2010

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.

Translate
LEGEND ,
Feb 26, 2010 Feb 26, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2010 Feb 26, 2010

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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 26, 2010 Feb 26, 2010
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources