The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
MarcusH
2 years agoValued Contributor
Unzip Application zip file
I am trying to save the XML files in the application zip file as separate XML files rather than a single zip. I get the zip file as a byte array and then pass that to XFZip.Unzip
The code ex...
- 2 years ago
Hi MarcusH
You can (also) use the System.IO.Compression namespace here to ExtractToDirectory. If you extract your zip file from a source directory e.g rather than from bytes(). Below is some sample code that achieves the same effect.
EDIT: just read your follow up comment. Sounds like you already know this 🙂
'' Imports the namespace 'Imports System.IO.Compression ' Get File Path (FileShare) Dim configSettings As AppServerConfigSettings = AppServerConfig.GetSettings(si) Dim fullPath As String = Path.Combine(FileShareFolderHelper.GetGroupsFolderForApp(si, True, configSettings.FileShareRootFolder, si.AppToken.AppName), "Administrators") ' The path of the zip file to decompress Dim zipPath As String = String.Format("{0}\archive.zip", fullPath) ' The path of the directory to extract the files to Dim extractPath As String = String.Format("{0}\extract", fullPath) If Not Directory.Exists(fullPath) Then Directory.CreateDirectory(fullPath) ' Extracts all the files from the zip file to the directory ZipFile.ExtractToDirectory(zipPath, extractPath)
MikeG
2 years agoContributor III
Hi MarcusH , Why not just extract the files one at a time? You either do it up front or splice apart the Full Application XML. Then you can push the metadata file to it's own folder, Dashboards to it's own folder, etc. It may be a quicker path to completing what you're wanting to do, which is just create backups as of a point in time, right?
Related Content
- 2 years ago