Some common registration and permission problems using csImageFile in Cold Fusion

On this page we will try to address some of the more common reasons for the component failing to work correctly.

1. 32 Bit v 64 Bit

Cold Fusion runs either as a 32 bit application or a 64 bit application and any COM object must match this. 64 bit Cold Fusion did not support COM objects initially, but from Cold Fusion 10 Update 11, it does support COM.

2. Registration

The DLL must be "registered" on the server before a script is able to call it. On a server, or local PC, that you have full access to, registration is easily achieved using the command line utility REGSVR32.EXE. We also provide a free registration tool that uses a Windows interface and that can be downloaded here. After registration the class name, class ID and DLL location are all recorded in the registry allowing the system to load the component when given the class name. DO NOT move or rename the DLL after registration. Remember to "Unregister" the component before deleting the DLL file. On a server administered by another company the server administrator will need to register the DLL.

Calling a COM object in Cold Fusion when it is not registered usually gives the error: "Error trying to create object specified in the tag. COM error 0x800401F3. Invalid class string"

3. Permission on the DLL file

For the component to be called from a Cold Fusion script running on the web server the account used by Cold Fusion must have Read and Execute permission on the DLL file itself. This account is usually the Local Service or Network Service account.

Insufficient permissions on the DLL file can lead to the error: "Error trying to create object specified in the tag. COM error 0x80070005. Access is denied."

4. Permissions on files and folders

In order to work with files on the server the account used by Cold Fusion must have appropriate permissions. Read for reading a file, Write for saving a file and Modify for overwriting an existing file.

5. Using network drives

If csImageFile needs to be used to read or write from a network drive it must be added to a COM+ Application in Component Services (found in "Administrative Tools"). It is relatively intuitive to open Component Services, expand as far as COM+ Applications and add a new application. From there the application can be expanded and a new component added from the available registered components. The COM+ Application allows the component to run as a specified Windows user or as the currently logged on user and then network access is possible.

6. Limitations of the trial version

The trial and full versions of csImageFile are distributed as two different files with different class names. The trial is called "csImageFileTrial.dll" and it is called using class="csImageFileTrial.Manage". The full version is called "csImageFile.Manage" and it is called using class="csImageFile.Manage". (For the 64 bit versions of the component these class strings are "csImageFile64Trial.Manage" and "csImageFile64.Manage") The trial version is fully functional up until the expiry date after which it can no longer be used to create or read images, although it can still be called and some functions still work. To find the expiry date, read the Version property:

<cfobject action="create" name="Image" class="csImageFileTrial.Manage">

It is possible to replace an old trial version with a newer DLL if more time is needed for evaluation. Simply overwrite the old DLL with the newer copy and no registering or unregistering is necessary. If an access denied error is generated when deleting the old file the Cold Fusion Application Server must be stopped and started to release the old DLL from memory. This can be done from Services in Windows Administrative Tools.

7. Physical paths

All the paths used for reading and writing files are full physical paths, not relative paths. If the physical path is not known, use the Cold Fusion function ExpandPath to find it.

8. Moving an application to another server

Sometimes an application can be running smoothly and then fail when it is moved to a new server. In this case, points 2 to 5 above should be checked. The paths to any input or output files should also be checked in case they are different and scripts are looking in the wrong places for files.