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
BenStuart
3 years agoNew Contributor III
Move File from Application Database to External Shared Drive
I currently have a metadata file being created by an Extender BR and saved down to the Application Database:
Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep
'Export File
Dim f...
- 3 years ago
You can move any file from onestream to external shared drive.
'1. Create your session here Dim sessionOptions As New SessionOptions With sessionOptions .Protocol = WinSCP.Protocol.Sftp .Portnumber = 22 .HostName = "" .UserName = "" .PrivateKeyPassphrase = "" .SshHostKeyFingerprint = "" .SshPrivateKeyPath = "" End With '2. Send file using the session FileName = "FileName.csv" Using session As New Session ' Connect session.Open(sessionOptions) Dim LocalDirectory As String = BRApi.FileSystem.GetFileShareFolder(si, FileShareFolderTypes.BatchHarvest, api) Dim Dest_folder As String ="" session.PutFiles(LocalDirectory & FileName, Dest_folder & FileName) End Using
RobbSalzmann
3 years agoValued Contributor II
BenStuart If the shared drive is mapped to a local drive letter on the server where OS is running, you write directly to it like this:
File.WriteAllBytes("Z:\OneStreamShare\FileShare\data.csv", System.Text.Encoding.Default.GetBytes(csv.ToString()))
Related Content
- 6 years ago