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
OS_Pizza
3 years agoContributor III
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- BenStuart3 years agoNew Contributor III
Hi OS_Pizza,
Does this require me to import any Namespaces? I tried adding the above to my existing Extender rule but it said that SessionOptions was not defined.
Many thanks
- OS_Pizza3 years agoContributor III
Absolutely ! Forgot to mention
Imports WinSCP- fellow_Ones9 months agoNew Contributor III
Hi -
I am running into below error on sessions even after importing namespaces and included dll in the reference assembly's section.
I am trying to move/copy multiple files from one stream file share path onto external Azure storage folder.
Thanks,
Related Content
- 6 years ago