Forum Discussion
Hi,
As Lee mentioned, if your OneStream environment is managed by the OneStream Customer Support team you may open a ticket and list the files/folders you wish to delete from the fileshare. This is currently the recommended and easiest approach.
If you are comfortable with business rules, you do have the ability to take matters into your own hands and create a custom rule to forcefully delete files/folders from the fileshare. I will post two basic snippets of how to delete a file and folder from the fileshare. Please keep in mind that the deleted files/folders will not be recoverable and performing these actions should be tested in a Development application first - if you take this approach you are doing this at your own risk.
Lastly, as a general FYI - there are multiple enhancements logged relating to this and I suspect/hope that at some point in the future deleting files/folders from the fileshare may be possible with standard platform or marketplace solution functionality.
'************************************************************************
'Example of deleting a file from the fileshare
'************************************************************************
'declare the filepath for the file on the fileshare you wish to delete
Dim configSettings As AppServerConfigSettings = AppServerConfig.GetSettings(si)
Dim sourceFilePath As String = FileShareFolderHelper.GetDataManagementExportUsernameFolderForApp(si, True, configSettings.FileShareRootFolder, si.AppName) & "\20211220\SomeFileName.csv"
'delete the file from the machine (warning, the file cannot be recovered)
File.Delete(sourceFilePath)
'*********************************************************************************
'Example of deleting a folder and its subdirectories and files from the fileshare
'*********************************************************************************
'declare the folder path for the folder on the fileshare you wish to delete
Dim configSettings As AppServerConfigSettings = AppServerConfig.GetSettings(si)
Dim sourceFolderPath As String = FileShareFolderHelper.GetDataManagementExportUsernameFolderForApp(si, True, configSettings.FileShareRootFolder, si.AppName) & "\SomeFileShareFolderName"
'delete the folder and all it's subdirectories and files in the directory (warning, the folder and nested directories/files cannot be recovered)
Directory.Delete(sourceFolderPath, True)
Nick Kroppe
OneStream Software
Related Content
- 10 months ago