ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Coldfusion Programming: Accessing a shared network drive

Updated on October 14, 2012

Introduction

As a Coldfusion developer, have you ever needed to use <CFdirectory> or <CFfile> on another network server or shared folder, other than the Coldfusion server? Trying to copy, move, delete or just check on files on another company server has always been an issue.


Coldfusion Installation.

The problem with not being able to access a shared/mapped drive from another server starts with the installation of Adobe Coldfusion.

The typical install, set's the service, "Coldfusion 8 Application Server", and all it's companion services as a "Local System Account". .

The first step would be changing this to the admin account used to login to the server.

STEPS:

1. Login to the web server.
2. Right click on My Computer
3. Click on the plus sign, next to "Services and Applications"
4. Click on "Services" Look on the right side panel of the list of services. Look for "Cold Fusion 8 Application Server", or the version Coldfusion you are running. You should see in the "Log On As" column, "Local System"
5. Right click on this service, and select "Properties".
6. Click on the "Log On" tab and select the radio button, "This account". Click on "Browse" button. The "Locations" should be the server name. In the Object box, you want to select the admin user account, used to logon, or type the user name.
7. Restart the server.

Once the Service, "Log On As" has been changed to the admin account used to log on to the web server, you can map to a shared network drive. Once the network drive is mapped, you can use this in your Coldfusion applications.

Example

Let's say I mapped "//172.16.0.75/support/" to drive letter T: and there are PDF files in a folder called "output". I want to use <CFdirectory> to list those files.

<cfdirectory directory="\\172.16.0.75\support\output\" 
             name="checkforpdf" 
             action="LIST" 
             filter="*.pdf" 
             sort="name" 
             listinfo="name">

NOTE: On the Network server you want to map to, you need to set-up a user on that server, with the same username as the username used on the Coldfusion server .

Click to Rate This Article