12-14-2022 07:02 AM - last edited on 05-25-2023 05:50 AM by JackLacava
I am storing a csv file in everyone path in filestore> Data Managemanet>Export> User folder. I want an BR that reads the file and compress (Create new .zip/ Override the .csv to .zip) and store in the same path. I am facing issues in same.
Solved! Go to Solution.
12-15-2022 04:26 AM
Never done it myself but a quick googling and StackOverflowing shows you should be able to use the libraries System.IO.Compression.Filesystem and System.IO.Compression, which have a ZipFile class. You might have to reference the necessary DLLs in the rule properties though.
12-15-2022 04:26 AM
Never done it myself but a quick googling and StackOverflowing shows you should be able to use the libraries System.IO.Compression.Filesystem and System.IO.Compression, which have a ZipFile class. You might have to reference the necessary DLLs in the rule properties though.
12-21-2022 04:05 AM
Hi @JackLacava ,
You are correct we were missing the dlls (XF\WinSCPnet.dll; C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.IO.Compression.dll; System.IO.Compression.FileSystem.dll) to include the Zip file class. We have used the library System.IO.Compression only. Zipfile class won't give you suggestions but will work as expected,
Dim ZipFileName As String = "Test.zip"
Dim ZipFilePath As String = BRApi.FileSystem.GetFileShareFolder(si, FileShareFolderTypes.ApplicationRoot, Nothing) & "\" & si.AppName.Replace(" ", String.Empty) & "\Groups\" & ZipFileName
ZipFile.CreateFromDirectory(exportFolderPath, ZipFilePath). this will store the the files under the folder path, exportFolderPath on the filepath, ZipFilePath.
02-20-2023 03:52 PM
Dim ZipFileName As String = "test.zip"
Dim folderLocation As String = FileShareFolderHelper.GetDataManagementExportUsernameFolderForApp(si, True, configSettings.FileShareRootFolder, si.AppName)
Dim ZipFilePath As String = folderLocation & "\" & ZipFileName
XFZip.Zip(ZipFilePath, folderLocation)
ZipFile is not working for me. I am working on OneStream on cloud. I think they do not have this library. But I found that they use their own method to zip files.
This is the poorest documentation I have seen ever. I spent hours to find this.
02-20-2023 05:18 PM
Hey Jarek, I'm sorry you had to suffer through this - we know documentation coverage is not where we'd like them to be, which is partially why this forum exists. Generally speaking, for anything related to "how do I do this thing in Cloud", feel free to chat with Support - chances are someone else had your problems before, and they are happy to make the necessary tweaks. As you can imagine, for security purposes, in Cloud a lot of stuff is not available until you tell us that you really really need it. This is probably one of them.
02-21-2023 06:57 AM
Hi Jack,
I fully agree. I hope that this forum is going to grow. I can see you are doing a good job in aim to make it.