Some Common Registration and Permission Problems Using csImageFile in ASP

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

1. 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 an ASP component that is not registered usually gives the error: "Server object error 'ASP 0177 : 800401f3' Server.CreateObject Failed ...Invalid ProgID."

2. Permission on the DLL file

For the component to be called from an ASP or other script running on the web server the Internet Guest User account (IUSR_machine_name) must have Read and Execute permission on the DLL file itself.

Insufficient permissions on the DLL file can lead to the error: "Server object error 'ASP 0178 : 80070005' Server.CreateObject Access Error The call to Server.CreateObject failed while checking permissions. Access is denied to this object."

3. Permissions on files and folders

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

4. Different Operating Systems

csImageFile, and all our ASP components, will run in all the Windows operating systems from 95 and NT 4 through to 2008 and Vista. There are some minor differences regarding registration in the later systems, Vista and Windows 2008 Server. In these systems registration must be done as an adminstrator so either run the command prompt as an administrator before using regsvr32.exe or run our DLLRegSvr tool as an administrator. On the 64 bit versions of Windows do not put the DLL in the Windows\System32 folder. Either run the web site in 32 bit mode or create a COM+ Application to run the component in 64 bit mode.

5. Using network drives

The local Internet Guest User account does not have authority to access 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"). Follow the instructions here. 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 Server.CreateObject("csImageFileTrial.Manage"). The full version is called "csImageFile.Manage" and it is called using Server.CreateObject("csImageFile.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 utility functions still work. To find the expiry date, read the Version property:

Set Image = Server.CreateObject("csImageFileTrial.Manage")
Response.Write Image.Version

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 web server must be stopped and the "Web Application" unloaded. In IIS Properties click the button marked "Unload" on the Home Directory tab and this will release any components from memory. When upgrading to the full version remember to change the Server.CreateObject commands in each script using the component.

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 Server.MapPath to find it. Alternatively, use csImageFile's CurrentDir and ParentDir functions.

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 1 to 4 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.