Forum Discussion
hbindu
8 months agoNew Contributor III
Hi,
I wrote an extensibility BR to extract data from OS to a csv file and the file is then moved to an FTP folder.
In your case instead of FTP folder it will be AWS S3 bucket.
below is the sample code:
If filecount > 0 Then
Dim sessionOptions As New SessionOptions
Dim transferOptions As New TransferOptions
Dim transferResult As TransferOperationResult
Using session As New Session
session.Open(sessionOptions)
transferOptions.TransferMode = TransferMode.Binary
transferOptions.OverwriteMode = OverwriteMode.Overwrite
'transferOptions.PreserveTimeStamp = True
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off
Dim RootFolder As String = $"{session.HomePath}/<RootFolderpath>"
files = From chkFile In Directory.EnumerateFiles(_path, "*.PGP", SearchOption.TopDirectoryOnly)
For Each Filepath In files
transferResult = session.PutFiles($"{Filepath}", RootFolder, False, transferOptions)
transferResult.Check()
Next
Using
End If
Related Content
- 3 years ago
- 4 months ago