Hey everyones, i want to upload my folder to dropbox without compress it to rar and without using Dropbox Dekstop (DD). is there possible or there is some function that allow my local folder work as local storage like dropbox dekstop ?.
I already read it greg, i want to pass the upload folder problem because when you using ordinary upload, you must compress it to rar, i want to make app work like Drobox Dekstop, where we can drag our folder without making rar of it and share it trough dropbox cloud storage. can i ?, can api do it ?
Hi greg i already made some improvement but, error keep haunting my program. so this is my code and the problem is this + $exception {"lookup_failed/closed/."} System.Exception {Dropbox.Api.ApiException<Dropbox.Api.Files.UploadSessionFinishError>}
Private Async Sub UploadToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles UploadToolStripMenuItem2.Click Dim C As New OpenFileDialog C.Title = "Choose File" C.Filter = "All Files (*.*)|*.*" If C.ShowDialog = Windows.Forms.DialogResult.OK Then Dim fileinfos = Path.GetFileName(C.FileName) Dim filetempat = Path.GetFullPath(C.FileName) Dim tempat As String = direktori.Text & "/" & fileinfos Await Upload(filetempat, tempat) End If End Sub Async Function Upload(localPath As String, remotePath As String) As Task Const ChunkSize As Integer = 4096 * 1024 Using fileStream = File.Open(localPath, FileMode.Open) If fileStream.Length <= ChunkSize Then Await A.Files.UploadAsync(remotePath, body:=fileStream) Else Await Me.ChunkUpload(remotePath, fileStream, ChunkSize) End If End Using End Function Private Async Function ChunkUpload(path As [String], stream As FileStream, chunkSize As Integer) As Task Dim numChunks As Integer = CInt(Math.Ceiling(CDbl(stream.Length) / chunkSize)) Dim buffer As Byte() = New Byte(chunkSize - 1) {} Dim sessionId As String = Nothing For idx As Integer = 0 To numChunks - 1 Dim byteRead = stream.Read(buffer, 0, chunkSize) Using memStream = New MemoryStream(buffer, 0, byteRead) If idx = 0 Then Dim result = Await A.Files.UploadSessionStartAsync(True, memStream) sessionId = result.SessionId kondisi.Text=byteRead Else Dim cursor = New UploadSessionCursor(sessionId, CULng(CUInt(chunkSize) * CUInt(idx))) If idx = numChunks - 1 Then Dim fileMetadata As FileMetadata = Await A.Files.UploadSessionFinishAsync(cursor, New CommitInfo(path), memStream) MessageBox.Show("Upload Complete") Console.WriteLine(fileMetadata.PathDisplay) Else Await A.Files.UploadSessionAppendV2Async(cursor, True, memStream) MessageBox.Show("Upload Failed") End If End If End Using Next End Function