Version 12.3 : Net core API GetImageFileInfo response error

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
jwalit.katira
Posts: 31
Joined: Mon Sep 18, 2023 1:41 pm

Version 12.3 : Net core API GetImageFileInfo response error

Post by jwalit.katira »

Hi Team,

I have updated Net Core API to Version 12.3, MyVintasoftImageCollectionApi/GetImageFileInfo is responding as error as below, I have not override this method

Code: Select all

{
    "files": null,
    "success": false,
    "blocked": false,
    "errorMessage": "Data storage item key is not correct. (Parameter 'key')\r\n",
    "requestId": null
}
Above is called when i give file to image viewer

Code: Select all

imageViewer.get_Images().openFile("C://Jwalit//Sample Files//24521447.tif");
Above is working properly in 12.2.11

Let me know if any changes need to be done for version 12.3

Thanks
Jwalit Katira
Alex
Site Admin
Posts: 2319
Joined: Thu Jul 10, 2008 2:21 pm

Re: Version 12.3 : Net core API GetImageFileInfo response error

Post by Alex »

Hi Jwalit,

In version 12.3 the "Data storage item key is not correct" error occurs if file identifier is a rooted path.

Why do you use rooted path as a file identifier?

Best regards, Alexander
jwalit.katira
Posts: 31
Joined: Mon Sep 18, 2023 1:41 pm

Re: Version 12.3 : Net core API GetImageFileInfo response error

Post by jwalit.katira »

Hello Alex,

I didn't understand and can you explain in detail or share an example what is wrong and how it need to done

Thanks
Jwalit Katira
Alex
Site Admin
Posts: 2319
Joined: Thu Jul 10, 2008 2:21 pm

Re: Version 12.3 : Net core API GetImageFileInfo response error

Post by Alex »

Hello Jwalit,

For solving the problem you need to do the following steps:
  • In each Vintasoft API controller override the CreateSessionDataStorage method:

    Code: Select all

    protected override IDataStorage CreateSessionDataStorage(string sessionId)
    {
        if (sessionId == null)
        {
            if (IsEmptySessionSupported)
                sessionId = "";
            else
                throw new ArgumentNullException("sessionId");
        }
    
        string path = Path.Combine("C://Jwalit//Sample Files", sessionId);
    
        if (!Directory.Exists(path))
            Directory.CreateDirectory(path);
    
        return new StreamDataStorage(path);
    }
    
  • Use file names (for example "24521447.tif") as file identifiers.

Please try to update your code and let me know if you will have any question or problem.

Best regards, Alexander
jwalit.katira
Posts: 31
Joined: Mon Sep 18, 2023 1:41 pm

Re: Version 12.3 : Net core API GetImageFileInfo response error

Post by jwalit.katira »

Hi Alex,

i am getting below message

Code: Select all

{
    "files": null,
    "success": false,
    "blocked": false,
    "errorMessage": "File \"24521447.tif\" is not found.\r\n",
    "requestId": null
}
i have also made changes in openfile as below

Code: Select all

imageViewer.get_Images().openFile("24521447.tif");
let me know if any changes need

Thanks
Jwalit Katira
Alex
Site Admin
Posts: 2319
Joined: Thu Jul 10, 2008 2:21 pm

Re: Version 12.3 : Net core API GetImageFileInfo response error

Post by Alex »

Hi Jwalit,

Data storage concatenates the storage folder path and file name if file path is necessary.

In your case:
1. The storage folder path is "C:/Jwalit/Sample Files/{sessionId}/"
2. File name is "24521447.tif"

Please make sure that your computer has file with path "C:/Jwalit/Sample Files/{sessionId}/24521447.tif".

Best regards, Alexander
jwalit.katira
Posts: 31
Joined: Mon Sep 18, 2023 1:41 pm

Re: Version 12.3 : Net core API GetImageFileInfo response error

Post by jwalit.katira »

Hi Alex ,

Yes it is working now , thanks for sharing

Thanks
Jwalit Katira
Post Reply