<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Setting My local folder as local storage and sync it trough my vb application without using DD in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/202163#M9594</link>
    <description>&lt;P&gt;Hi greg i already made some improvement but, error keep haunting my program. so this is my code and the problem is this&amp;nbsp;+ $exception {"lookup_failed/closed/."} System.Exception {Dropbox.Api.ApiException&amp;lt;Dropbox.Api.Files.UploadSessionFinishError&amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;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 &amp;amp; "/" &amp;amp; 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 &amp;lt;= 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&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Jan 2017 15:00:03 GMT</pubDate>
    <dc:creator>Blue_Maniac</dc:creator>
    <dc:date>2017-01-18T15:00:03Z</dc:date>
    <item>
      <title>Setting My local folder as local storage and sync it trough my vb application without using DD</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/201879#M9561</link>
      <description>&lt;P&gt;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 ?.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:26:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/201879#M9561</guid>
      <dc:creator>Blue_Maniac</dc:creator>
      <dc:date>2019-05-29T09:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Setting My local folder as local storage and sync it trough my vb application without using DD</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/201987#M9568</link>
      <description>Dropbox does offer an API you can use to upload and download files without using the official Dropbox desktop application.&lt;BR /&gt;&lt;BR /&gt;You can find everything you need to get started with the Dropbox API, including documentation, tutorials, and SDKs here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers" target="_blank"&gt;https://www.dropbox.com/developers&lt;/A&gt;</description>
      <pubDate>Fri, 13 Jan 2017 18:50:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/201987#M9568</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-13T18:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Setting My local folder as local storage and sync it trough my vb application without using DD</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/202042#M9581</link>
      <description>&lt;P&gt;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 ?&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2017 00:41:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/202042#M9581</guid>
      <dc:creator>Blue_Maniac</dc:creator>
      <dc:date>2017-01-14T00:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Setting My local folder as local storage and sync it trough my vb application without using DD</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/202051#M9585</link>
      <description>You don't need to compress a folder when uploading it via the Dropbox API. You would need to make an API call to upload each file in the folder though. You can use the /2/files/upload endpoint (or corresponding method in an SDK) to do so:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#files-upload&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 14 Jan 2017 01:02:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/202051#M9585</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-14T01:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Setting My local folder as local storage and sync it trough my vb application without using DD</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/202163#M9594</link>
      <description>&lt;P&gt;Hi greg i already made some improvement but, error keep haunting my program. so this is my code and the problem is this&amp;nbsp;+ $exception {"lookup_failed/closed/."} System.Exception {Dropbox.Api.ApiException&amp;lt;Dropbox.Api.Files.UploadSessionFinishError&amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;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 &amp;amp; "/" &amp;amp; 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 &amp;lt;= 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&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jan 2017 15:00:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Setting-My-local-folder-as-local-storage-and-sync-it-trough-my/m-p/202163#M9594</guid>
      <dc:creator>Blue_Maniac</dc:creator>
      <dc:date>2017-01-18T15:00:03Z</dc:date>
    </item>
  </channel>
</rss>

