Page 1 of 1

Loading an image from a different directory than the application is running

Posted: Tue Jun 01, 2021 11:38 pm
by david.morrison
I am trying to use annotationViewer1.get_Images().openFile(filename, fileLoadComplete, fileLoadError);
to load an image. As long as filename is under the application base folder (c:\inetpub\wwwroot\sitename\Images\image1.png), it works fine. How can I load an image from a different filepath, such as a completely different drive (e:\Images\image1.png)?
If I try passing the full filepath "e:\Images\image1.png" to the openFile() method it gives an error: "The given path's format is not supported".

Re: Loading an image from a different directory than the application is running

Posted: Wed Jun 02, 2021 8:50 am
by Alex
Hello,

By default web viewer can open image file if image file is stored in application folder on server side.

In your case image file is not stored in application folder on server side. In this case you can go by 2 ways.

WAY 1: Copy image file to the application folder.

WAY 2: Create custom data storage and override algorithm that load file data. Please read how to view images from database here: https://www.vintasoft.com/docs/vsimagin ... abase.html Use this example and use custom file folder instead of database access.

Let me know if you will have any question or problem.

Best regards, Alexander