You are viewing limited content. For full access, please sign in.

Question

Question

Access to the path is denied

asked on March 6, 2017

I am looking to use the SDK to import text from a folder location, but workflow is returning an 'Access to path is denied' error.  I need to determine what account workflow is using to access the folder location so I can ensure that the appropriate user(s) have access to read data.  

Below is the code I am using:

        {
            // Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            DocumentInfo document = new DocumentInfo(this.Connection);
            document.Create("\\OTG", "DEFAULT", EntryNameOption.AutoRename);
            DocumentImporter DI = new DocumentImporter();
            DI.Document = document;
            DI.OcrImages = true;
            DI.ImportImages("C:\\test\\OTG");
        }

Note: When I change the volume to 'DEFAULT000025' which is my current volume iteration, the system throws an error of just 'Access Denied'

Error message:

Any help is much appreciated!

Thanks,

Nate

0 0

Replies

replied on March 6, 2017 Show version history

Cause of error

The message you saw, "Access to the path C:\test\OTG is denied", is due to the fact that ...

DocumentImporter.ImportImages(string imagePath)

... cannot be used to import a folder of images. Instead, it is intended for importing a single image file. The image file can be single-page (such as PNG or JPEG), or multi-page (such as TIFF).

Suggestion

To import from multiple image files, please use ...

Laserfiche.DocumentServices.ListImporter

... instead.

This is available in Laserfiche 10.2. The list file syntax can be found in the SDK documentation, though it might be listed under the COM-based SDK. The same list file syntax can be used with either COM or .NET SDK.

If you cannot use ListImporter, the next option will be to use ImportEngine. However, ImportEngine requires you to write a well-formed XML file (which will be validated against an XML schema) in order to perform an import.

General advice when dealing with scripting errors

If you have access to SDK and Visual Studio, it would be easier to debug your script by implementing a test version of it as a .NET console application first. The benefits are:

  • You can use Visual Studio debugging while it is executing,
  • You can see the line of code that throws the error,
  • You can inspect the local variables inside your script at the point where the error happens,
  • You can specify the credentials when connecting to Laserfiche repository, so that you can easily confirm or rule out login-related issues early in the troubleshooting process.

 

In general it is recommended to use exception handling and logging, whether within WF scripting or with standalone test application.

1 0
replied on March 7, 2017

I like to use Process Explorer and Process Monitor in situations like this. Process Monitor makes it possible to find which process attempted to write to the directory, Process Explorer shows the user that the process is running as (probably LocalSystem).

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.