Discussion:
CFFILE on Network Drives
(too old to reply)
drew222
2005-10-06 19:58:00 UTC
Permalink
Hi,

I have a windows server and mapped network drives and I have found that
CFDIRECTORY and CFFILE don't recognize the directory structure. Is there a new
method for obtaining files from a networked environment?

Thanks for your help,
mpwoodward *TMM*
2005-10-06 21:07:01 UTC
Permalink
Post by drew222
Hi,
I have a windows server and mapped network drives and I have found that
CFDIRECTORY and CFFILE don't recognize the directory structure. Is there a new
method for obtaining files from a networked environment?
Thanks for your help,
The typical issue with CF going to network drives (either mapped or UNC)
is that by default CF on Windows runs under the default System account,
which has no network access. You'll have to change the user CF is
running as to one that does have network access and also has permissions
on the drives you're trying to access.

Matt
--
Matt Woodward
***@gmail.com
Team Macromedia - ColdFusion
BSterner
2005-10-06 21:09:57 UTC
Permalink
I think the coldfusion server has to be logged in as the user who has the
network permissions. You can then reference it using...

<cffile action="write" file="\\Network_Root\SubFolder\file.txt" output="data"
/>
drew222
2005-10-06 21:28:28 UTC
Permalink
The CF is running as Administrator. I know that UNC names work however network
(mapped) drives don't seem to work. For examples, <CFDIRECTORY ACTION="LIST"
DIRECTORY="Z:\TEMP" Name="LIST" FILTER="*.txt"> will return nothing.
CFDirectory doesn't return an error but CFFILE does. I'm not sure why this
doesn't work as it did in previous versions.

Any thoughts?
mpwoodward *TMM*
2005-10-06 23:29:42 UTC
Permalink
Post by drew222
The CF is running as Administrator. I know that UNC names work however network
(mapped) drives don't seem to work. For examples, <CFDIRECTORY ACTION="LIST"
DIRECTORY="Z:\TEMP" Name="LIST" FILTER="*.txt"> will return nothing.
CFDirectory doesn't return an error but CFFILE does. I'm not sure why this
doesn't work as it did in previous versions.
Any thoughts?
If the CF user is logged on as the local administrator account to the
local box, that account still has to have permissions to access the
other drive. Not sure if you already checked that, but the
Administrator account on the local box doesn't necessarily give it the
necessary rights to hit the remote drive. If it *is* set up that way
already and it still isn't working then I'm not sure what's going
on--I'd have to experiment a bit.

Matt
--
Matt Woodward
***@gmail.com
Team Macromedia - ColdFusion
Joser88
2005-10-07 00:05:02 UTC
Permalink
I too am having the same problem. The CF7 service is being run by a local
account that does have read/write access to the network drive.

This fails...

<cffile action="COPY" source="G:\test.txt" destination="C:\Temp\test.txt">


But this works with G:\ mapping to \\Server02\Share

<cffile action="COPY" source="\\Server02\Share\test.txt"
destination="C:\Temp\test.txt">

Doing COPY G:\test.txt C:\TEMP\test.txt via command prompt logged in as the CF
user also works.
fnabulsi
2005-10-07 03:20:38 UTC
Permalink
test reply
jorgepino
2005-10-07 12:04:43 UTC
Permalink
make sure to only give access to the drive and Folder you need to see and not a blanket access to all drives
povphile2
2005-10-07 12:26:30 UTC
Permalink
It has been my experience that those drives are only mapped, they have not been
accessed yet so you cannot use CFDirectory on them.

A good test of this would be to log into the server, browse to a couple of the
drives, then try to run CFDirectory on those drives.

Regards
Wil
drew222
2005-10-08 01:35:34 UTC
Permalink
Let me clear this up. I have 2 machines in which case both machines are logged
in as Administrator. I have an account called Admin (which is a second
adminstrator account) and the mapped drives have full control over the
directory structure on the remote machine. I can do anything I want from the
command line. However, when I run a CFM with CFDirectory or CFFILE, I either
get NO response or an error.

Also, if I use UNC instead of the mapped drive letter then it works fine
(including copying a file). Because this works, then the permission issue also
proves that I do it.

This is NOT a permission issue (at least in my humble opinion) since I have
NO accounts on any machine other then administrators.

Suggestions as to what to look for.
mpwoodward *TMM*
2005-10-08 12:37:39 UTC
Permalink
Post by drew222
Let me clear this up. I have 2 machines in which case both machines are logged
in as Administrator. I have an account called Admin (which is a second
adminstrator account) and the mapped drives have full control over the
directory structure on the remote machine. I can do anything I want from the
command line. However, when I run a CFM with CFDirectory or CFFILE, I either
get NO response or an error.
Also, if I use UNC instead of the mapped drive letter then it works fine
(including copying a file). Because this works, then the permission issue also
proves that I do it.
This is NOT a permission issue (at least in my humble opinion) since I have
NO accounts on any machine other then administrators.
Suggestions as to what to look for.
Interesting--one thought: do mapped drives depend on someone actually
being logged into the computer? I could see how this might be the case.
I'd have to experiment to be sure, but my thought is that if CF is
just running but there isn't an actual user logged into the server
itself, those mapped drives might not get mapped (if that makes sense).
Is there a problem using UNC if that works?

Matt
--
Matt Woodward
***@gmail.com
Team Macromedia - ColdFusion
drew222
2005-10-09 00:11:41 UTC
Permalink
To answer your question, UNC works fine.

As for the mapping being a different user is an nteresting thought. I know
that when I worked on operating systems, if a drive is mapped, the mapping
happens for ALL users regardless of type of user. This is a function of the OS
to ensure that all mappings are global. If not, the OS would have a horrible
time making sure that the correct drive letter is mapped to the right user.
Windows is not different in this regard. I find it interesting that it worked
in previous version of CF (including MX 6.1) but doesn't work in MX 7.

I'm open to trying things.
jorgepino
2005-10-10 14:56:43 UTC
Permalink
you could always run CFMX 7 as an user who does have access to the Drive
drew222
2005-10-10 15:18:55 UTC
Permalink
As stated before, I have several machines and all the accounts are
Administrator. There are NO user accounts other than Administrator. The system
has full rights to all drives (regardless of whether they are mapped or not).

This feature was working in MX6.1 (as I have this also running on another
machine). I'm trying to find out why its not working in MX7.0.

Loading...