Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using <cfdirectory> to access files on another server

Status
Not open for further replies.

numbered

Technical User
Jun 10, 2002
54
CA
I'm using <cfdirectory> and I'm trying to access a directory on another server. If I'm on server 1 I can get to server 2. I can't seem to get from server 1 to server 2 using coldfusion though.

I've tried the mapped path and I've tried the hard coded path, neither work.

<CFSET LibraryDirectory = &quot;p:\folder\folder2&quot;>
or
<CFSET LibraryDirectory = &quot;\\server2\folder\folder2&quot;>

<CFDIRECTORY
action=&quot;LIST&quot;
directory=&quot;#LibraryDirectory#&quot;
name=&quot;GetFiles&quot;
filter=&quot;Media*.pdf&quot;
sort=DateLastModified>

Can coldfusion access files on another server?

 
You need to let ColdFusion log onto the server as a specific user. You do this by going into services and changing the logon as and password fields to the username and password of either an existing user, or a user you've created specifically for the Cold Fusion Application Server service.

-Tek
 
Until recently, I would have responded with a resounding &quot;NO&quot;. I've experimented with this in the past and had no luck.

However, I've recently been thinking more about it in connection with security. When my company moves to ColdFusion MX, we'll be doing a fresh install on a new server. I'm going to experiment with having the ColdFusion service start with the privileges of a domain account instead of LocalSystem (which is the default). I'm thinking that might help the situation.

You could try changing the properties of the &quot;Cold Fusion Application Server&quot; service so that it starts up under a domain-level account. You may have to change permissions in the webroot and in your cfusion directory (or whatever it's called in later versions -- the directory where the binary files exist for ColdFusion) so that the domain user has access to the appropriate files. Here's an article with more information on the permissions needed:


That may allow you to access directories on other servers. This is a pretty drastic change, so experiment at your own risk. But let me know how it goes!

-Patrick
Did I help? Vote!
 
Nice work Tek, we were obviously writing our responses at the same time. Great minds think alike, eh?
 
Yep, I actually found the defusion.com article but then I figured Macromedia would have something more up to date and less complicated in the KB, but finding specific articles on there is mostly fruitless. I'm glad you posted the defusion.com link.

-Tek
 
Never tried it... but I also believe that CFIMPERSONATE can help you access another server as a specific user by setting the type to &quot;OS&quot; (apparently available in under Windows).

Hope it helps,
-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top