Have tried one of your examples for uploading larger files, getting on error on this line
updated = CType(ChunkUpload((filePath + ("/" + fileName)), fs, ChunkSize, dbx), Task(Of FileMetadata))Additional information: Unable to cast object of type 'System.Threading.Tasks.Task`1[System.Threading.Tasks.VoidTaskResult]' to type 'System.Threading.Tasks.Task`1[Dropbox.Api.Files.FileMetadata]'.
it relatesd to the function below, which is cast as a task
Private Async Function ChunkUpload(ByVal path As String, ByVal stream As FileStream, ByVal chunkSize As Integer, dbx As DropboxClient) As Task
Dim numChunks As Integer = CType(Math.Ceiling((CType(stream.Length, Double) / chunkSize)), Integer)
Dim buffer() As Byte = New Byte((chunkSize) - 1) {}
Dim sessionId As String = Nothing
Dim idx = 0
Do While (idx < numChunks)
Dim byteRead = stream.Read(buffer, 0, chunkSize)
Dim memStream = New MemoryStream(buffer, 0, byteRead)
If (idx = 0) Then
Dim result = dbx.Files.UploadSessionStartAsync(False, memStream)
sessionId = CType(result.Id, String)
Else
Dim cursor = New UploadSessionCursor(sessionId, CType((chunkSize * idx), System.UInt64))
If (idx _
= (numChunks - 1)) Then
Dim fileMetadata As FileMetadata = Await dbx.Files.UploadSessionFinishAsync(cursor, New CommitInfo(path), memStream)
Console.WriteLine(fileMetadata.PathDisplay)
Else
Await dbx.Files.UploadSessionAppendV2Async(cursor, False, memStream)
End If
End If
idx = (idx + 1)
Loop
End Function
Can you give any advice