EDMI: Fix byte array creation

This commit is contained in:
Jonathan Jenne 2020-05-15 12:26:59 +02:00
parent 9a70252ff3
commit 9b290cce72
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ Public Class Form1
AddLogMessage($"Importing {oFileInfo.Name}... ({FormatBytes(oFileInfo.Length)})") AddLogMessage($"Importing {oFileInfo.Name}... ({FormatBytes(oFileInfo.Length)})")
Dim oObjectId As Long = Await _Client.ImportFileAsync(oFileInfo.Name, "WichtigesDokument", 1, 0) Dim oObjectId As Long = Await _Client.ImportFileAsync(oFileInfo.FullName, "WichtigesDokument", 1, 0)
AddLogMessage($"File with Id [{oObjectId}] imported!") AddLogMessage($"File with Id [{oObjectId}] imported!")
oSW.Stop() oSW.Stop()
AddLogMessage($"Import Time: {FormatTime(oSW.ElapsedMilliseconds)}") AddLogMessage($"Import Time: {FormatTime(oSW.ElapsedMilliseconds)}")

View File

@ -81,7 +81,7 @@ Public Class Client
End If End If
Using oStream As New FileStream(FilePath, FileMode.Open) Using oStream As New FileStream(FilePath, FileMode.Open)
Dim oContents As Byte() = {} Dim oContents(oStream.Length) As Byte
Dim oBytesRead = Await oStream.ReadAsync(oContents, 0, oStream.Length) Dim oBytesRead = Await oStream.ReadAsync(oContents, 0, oStream.Length)
Dim oData As New DocumentImportRequest() With { Dim oData As New DocumentImportRequest() With {
.FileName = oFileInfo.Name, .FileName = oFileInfo.Name,