Skip to main content
Inspiring
March 24, 2009
Answered

Linking with Mapped Network Drives

  • March 24, 2009
  • 7 replies
  • 2719 views
CF has permission to access a mapped drive, and I can use cfdirectory to list all the files in the folders I want, but why I try to link to them, CF says it cannot find the file. When I try to go to just the mapped drive in an IE window, I have to put in a username/password, but cfdirectory doesn't have those kinds of attributes. My sysadmin suggests that I upload the necessary files to the CF server, which I can do with cffile action="copy", but I'd prefer to keep everything on the mapped drive.

Any suggestions? Thanks!
This topic has been closed for replies.
Correct answer Newsgroup_User
kodemonki wrote:
> I can read the directory (show a list of files, etc) with cfdirectory just
> fine, but I am trying to use an anchor, much like this:
> <a href="\\myserver.mydomain.com\public\Public_Users\kate\#name# where #name#
> is the file returned from cfdirectory.
>

How does the file returned from the <cfdirectory...> tag relate to the
web root directory of \\myserver.mydomain.com\?

I suspect you may need some type of mapping|virtual directory|symbolic
link here depending on what flavor of OS and Web Server you are utilizing.

The other issue could be a difference in permissions between the user
ColdFusion runs under which is used to read the directory with
<cfdirectory...> and the user used by the Web Server for client requests.

7 replies

kodemonkiAuthor
Inspiring
March 25, 2009
Virtual directories worked perfectly, thank you!
tclaremont
Inspiring
March 25, 2009
As a test, while on the server, map the drive in question....say, as the G:\ drive. Then try your CFM page again, using the G:\foldername\filename approach.
Newsgroup_UserCorrect answer
Inspiring
March 25, 2009
kodemonki wrote:
> I can read the directory (show a list of files, etc) with cfdirectory just
> fine, but I am trying to use an anchor, much like this:
> <a href="\\myserver.mydomain.com\public\Public_Users\kate\#name# where #name#
> is the file returned from cfdirectory.
>

How does the file returned from the <cfdirectory...> tag relate to the
web root directory of \\myserver.mydomain.com\?

I suspect you may need some type of mapping|virtual directory|symbolic
link here depending on what flavor of OS and Web Server you are utilizing.

The other issue could be a difference in permissions between the user
ColdFusion runs under which is used to read the directory with
<cfdirectory...> and the user used by the Web Server for client requests.

kodemonkiAuthor
Inspiring
March 25, 2009
I can read the directory (show a list of files, etc) with cfdirectory just fine, but I am trying to use an anchor, much like this:
<a href="\\myserver.mydomain.com\public\Public_Users\kate\#name# where #name# is the file returned from cfdirectory.
Inspiring
March 25, 2009
kodemonki wrote:
> I am using the UNC path. I've also tried the IP address.
> And yes, my CF app server service is running under a windows domain account.

Are you having trouble reading this directory with CFML using
<cfdirectory...> and|or <cffile...> tags *OR* are you trying to create
HTML anchor <a...> links that would require this directory to be
accessible under a web root?

kodemonkiAuthor
Inspiring
March 25, 2009
I am using the UNC path. I've also tried the IP address.
And yes, my CF app server service is running under a windows domain account.
Inspiring
March 25, 2009
Try using the UNC path instead of a mapped drive.

See this article:
http://www.adobe.com/go/9616b854
Inspiring
March 25, 2009
Is your CF application server service running under a windows domain account?