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

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Moderator: Alex

Post Reply
david.morrison
Posts: 6
Joined: Thu Oct 10, 2019 10:40 pm

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

Post 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".
Alex
Site Admin
Posts: 2304
Joined: Thu Jul 10, 2008 2:21 pm

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

Post 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
Post Reply