Forum Discussion

SRAI's avatar
SRAI
New Contributor III
3 years ago

Importing a CSV file from from Documents/Public/xyz folder to OneStream Cube

Hi, I have a requirement to import a Cell Details CSV file into OS. My questions are as below: 1. Can we import a CSV file from Documents/Public/xyz folder to OneStream Cube? I tried it but it di...
  • ckattookaran's avatar
    3 years ago

    Try this

    Dim fileName As String = "CellDetails.csv"
    Dim usrfile As XFFileEx = BRApi.FileSystem.GetFile(si, FileSystemLocation.ApplicationDatabase, "Documents/Public/" & fileName, True, True)
    Dim fileBytes As Byte() = usrfile.XFFile.ContentFileBytes
    File.WriteAllBytes($"{BRApi.Utilities.GetFileShareFolder(si, FileShareFolderTypes.ApplicationIncoming, Nothing).Replace("Incoming", "")}DataManagement\Export\{StringHelper.RemoveInvalidNameCharacters(si.UserName, False, False)}\{fileName}", fileBytes)