Skip to main content
Kofax

Limitation of TisImageViewer API of Path Max at 128 Characters

Article # 3046987 - Page views: 24

Issue

There is scenario where customers implemented a Custom Station and used TisImageViewer API, then there was error encountered especially when eFlow AppData was not installed at Drive C. 

public class Viewer : TiS.TisViewServicesCW.TisViewServicesControl
{
   public string CurrentImagePath { get; set;}

   public Viewer()
   ....
   
   public void SetImagePath(string imgpath)
   ....
   
   public void FitImage()
   ....
}

Checking the TIS Log, the error thrown is "TTisViewEngine.VEOpenView got an error when calling FowViewOpen Code :IO error".

When the Custom Station gets collection, as per core function, the TIF file of the collection will be downloaded to the Client AppData path:

  • <Installed eFlow AppData Path>\Client\<AppName>\WorkDir\<machine name>_<station exe filename w/o file extension>_<"GUID" type e.g. 19156_8232696335401884932>\<collection name>.tif

It was found that if the downloaded full path file name exceeds 128 characters then the error will be encountered.

Cause

Why more than 128 chars absolute file path is working for C but not in D or E drives (or other drives)?

The actual file path limit in the eFlow core for this API is 128 chars only irrespective of drives.  

However, when you pass the file path more than 128 characters from C drive (if OS is installed in C) then a short file path (up to 128 chars) is being used internally.  This is the reason for file path lengths up to 260 chars are working from C.

  • Below is an example found for the filename through debugging the codes where AppData is at Drive C (OS at Drive C), we could find the path became shorter with those ~ (something like 8.3 format for file path) 

ImageViewer.Image.FileName.png

Note: It has been as such even as early as eFlow 5.X where there may be several factors e.g. Delphi relation and "old codes" length restriction, etc.

Solution

1. If this API has to be used then reduce the path length for the downloaded TIF so that it does not exceed its limitation or consider set Short Name using “fsutil”.

Below are some suggestions to shorten the path length upon considering the format of the downloaded TIF path.

  • Set a shorter Exe filename
  • Set a shorter Application Name (e.g. when installing cab or when duplicate application)
  • If you are setting collection name then avoid long collection name.
  • You could also consider having a shorter eFlow AppData path when you installed eFlow at the machine(s).

2. Replace image viewer with other viewers using .NET

 

Level of Complexity 

Easy

 

Applies to  

Product Version Build Environment Hardware
eFlow 5.X  to 6.X      

References

 

Article # 3046987
  • Was this article helpful?