Hi Jayesh,
Thanks for sharing the feedback with us.
The API does not provide any builtin function to delete files from the storage folder. You can delete these files manually or by using some code. There is a workaround in which you can use ClearCache function to remove cache files as well as the other files in the storage by using the same folder for both. However, in this case, each time when you remove cache files, all the other files in storage folder will also be removed. Following code snippet uses same folder for storage directory and for the cache directory as well.
<span class=“pl-k” style=“box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>private<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> <span class=“pl-k” style=“box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>static<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> <span class=“pl-k” style=“box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>string<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> _storagePath = HttpContext.Current.Server.MapPath(<span class=“pl-s” style=“box-sizing: border-box; color: rgb(24, 54, 145); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>"~/_layouts/15/GroupDocs-Viewer-SharePoint/Storage/"<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>);
<span class=“pl-k” style=“box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>private<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> <span class=“pl-k” style=“box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>static<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> <span class=“pl-k” style=“box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>string<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> _tempPath = HttpContext.Current.Server.MapPath(<span class=“pl-s” style=“box-sizing: border-box; color: rgb(24, 54, 145); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>"~/_layouts/15/GroupDocs-Viewer-SharePoint/Storage/"<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>);
<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>
Configuration settings:
<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>_config = <span class=“pl-k” style=“box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>new<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> ViewerConfig
<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>{
<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> StoragePath = _storagePath,
<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> CachePath = _tempPath,
<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”> UseCache = <span class=“pl-c1” style=“box-sizing: border-box; color: rgb(0, 134, 179); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>true
<span style=“color: rgb(51, 51, 51); font-family: Consolas, “Liberation Mono”, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);”>};
In case of any confusion, please do let us know.
Warm Regards