Forum Discussion

BenStuart's avatar
BenStuart
New Contributor III
2 years ago

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...
  • OS_Pizza's avatar
    2 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