Hi,
I had created sample project by following this tutorial.
https://www.vintasoft.com/docs/vsimagin ... ation.html
Its working fine, but Its currently upload the files in the folder "wwwroot/UploadedImageFiles", and creating all cache data in the folder "wwwroot/VintasoftCache", I want to change these paths.
Please advise. And also can you advise to clear cache data programmatically after save/burn annotations.
Thanks,
Change default path for upload and cache storage
Moderator: Alex
-
- Posts: 9
- Joined: Wed Mar 02, 2022 3:07 pm
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Change default path for upload and cache storage
Hi John,
Please also read how to create custom data storage for image files here: https://www.vintasoft.com/docs/vsimagin ... abase.html
The WebImageCacheManagerJS class allows to manage cache of web images.
Best regards, Alexander
If you want to change name of upload directory from "UploadedImageFiles" to other name in ASP.NET Core project, you need to do the following steps:Its working fine, but Its currently upload the files in the folder "wwwroot/UploadedImageFiles", and creating all cache data in the folder "wwwroot/VintasoftCache", I want to change these paths.
- Create custom API controller that is derived from VintaSoft API controller. For example, create MyVintasoftImageApiController class derived from Vintasoft.Imaging.AspNetCore.ApiControllers.VintasoftImageApiController class. Remember, you need to create custom API controller for each used web service, i.e. VintasoftImageApiController, VintasoftImageCollectionApiController, etc.
- In created class override the CreateSessionDataStorage method. Here is example:
Code: Select all
protected override IDataStorage CreateSessionDataStorage(string sessionId) { if (sessionId == null) { if (IsEmptySessionSupported) sessionId = ""; else throw new ArgumentNullException("sessionId"); } string path = Path.Combine(HostingEnvironment.WebRootPath, "UploadedImageFiles", sessionId); if (!Directory.Exists(path)) Directory.CreateDirectory(path); return new StreamDataStorageOnDisk(path); }
Please also read how to create custom data storage for image files here: https://www.vintasoft.com/docs/vsimagin ... abase.html
You can get image cache manager of web image viewer using the WebImageViewerJS.get_ImageCacheManager function.And also can you advise to clear cache data programmatically after save/burn annotations.
The WebImageCacheManagerJS class allows to manage cache of web images.
Best regards, Alexander