Coldfusion Programming: Accessing a shared network drive

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 .

More by this Author

  • Tips For How to Stain Concrete Floors
    1

    You don't always have to tile, carpet, or hardwood your floors. The new thing is to just stain the concrete that's already there. It's a lot of work, but if done properly, your home will look gorgeous. If you're...

  • How to Get Rid of Mice In and Around The House?
    5

    Until this year, the only time that I've had mice or rats in the house were when my daughter had pet mice and rats, and one of those times we did have one loose in the house. (Science fair project got loose.) Anyway,...

  • How to Build Wooden Roof Trusses
    21

    You may refer to a truss as the rafter, but it's basically the skeleton of the roof, carrying the weight of the frame and supporting the walls of the building. Trusses are very important to preventing the walls from...


Click to Rate This Article
working