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 executes without an error and without any files being saved as well. Does anyone have any suggestions or can point out where I am going wrong with the code?
OnPrem V7.4.2
Dim xmlOptions As New XmlExtractOptions
xmlOptions.ExtractAllItems = True
Dim folderNameForExtract As String = "XMLs"
Dim extractPath As String = $"{Environment.GetEnvironmentVariable ("Temp")}\{folderNameForExtract}\"
'Execute the Metadata Extract
Using dbConnFW As DBConnInfo = BRAPi.Database.CreateFrameworkDbConnInfo(si)
Using dbConnApp As DBConnInfo = BRAPi.Database.CreateApplicationDbConnInfo(si)
Dim zippedBytes As Byte() = ApplicationZipFileHelper.Extract(dbConnFW, dbConnApp, Nothing, xmlOptions)
XFZip.Unzip(zippedBytes, extractPath)
End Using
End Using