New File Creation from binary array

Call Method
   Sub CreateFile (FilesID As String, FileName As String, Description As String, ByteArray As Byte[])
         Files object ID
         File name and type (ex: File.wav)
         File description
         File data as byte array
VB.NET Example Switch to language: [C#]
  'Create personalizer object and Session object
  Dim pers As New PersonalizerRef.Personalizer()
  Dim sess As New SessionRef.Session()
  Dim SessionID As String = ""
      SessionID = pers.CreateSession("LogonName", "Password")
      'Read file (file.wav) from disk
      Dim fstream As FileStream = File.OpenRead("file.wav")
      Dim bytedata(fstream.Length) As Byte
      Dim readcnt As Long = fstream.Read(bytedata,0,bytedata.Length)
      'Get Files Object
      Dim objFiles As New FilesRef.Files()
      'Get Files object ID
      Dim FilesID As String = sess.GetFiles(SessionID)
      'Create file
      objFiles.CreateFile(FilesID, "filename.wav", "speak prompt", bytedata)
      Dim FileName As String
      'Get first filename
      While FileName <> ""
          'Print file name
          Console.WriteLine("Found File=" & FileName)
          FileName = objFiles.GetNextFile(FilesID)
      End While
  Catch e As Exception
      'Print exception message e.Message
  End Try