<?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: Large Data Upload in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306453#M18466</link>
    <description>&lt;P&gt;OK, getting a bit further now, what if I already have a shared folder that exists, I get the exception&amp;nbsp;"bad_path/already_shared", can I check if a folder share already exists?&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 23:17:45 GMT</pubDate>
    <dc:creator>solsupp</dc:creator>
    <dc:date>2018-10-30T23:17:45Z</dc:date>
    <item>
      <title>Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305041#M18399</link>
      <description>&lt;P&gt;Now have large data upload working, only 1 thing I cant do is share the folder.&amp;nbsp; Errors on bold text, how do I get the parent shared folder ID after upload.&lt;/P&gt;&lt;PRE&gt; Private Async Function ChunkUpload(path As [String], stream As FileStream, chunkSize As Integer, dbx As DropboxClient) 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 = 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 dbx.Files.UploadSessionStartAsync(False, memStream)
                    sessionId = result.SessionId
                Else
                    Dim cursor = New UploadSessionCursor(sessionId, CULng(CUInt(chunkSize) * CUInt(idx)))

                    If idx = numChunks - 1 Then
                        Dim fileMetadata As FileMetadata = Await dbx.Files.UploadSessionFinishAsync(cursor, New CommitInfo(path), memStream)
                        Console.WriteLine(fileMetadata.PathDisplay)

                        Dim myIssueID As Integer = CInt(GridView1.GetRowCellValue(GridView1.FocusedRowHandle, "Issue_ID").ToString)
                        Dim myMembers() As AddMember = Nothing

                        If GridView1.SelectedRowsCount &amp;gt; 0 Then

                            Dim myIssueRecipientsDatatable As System.Data.DataTable
                            Dim myIssueRecipientsTableAdapter As ArchetypeDBDataSetTableAdapters.draw_issueesTableAdapter = New ArchetypeDBDataSetTableAdapters.draw_issueesTableAdapter
                            myIssueRecipientsDatatable = myIssueRecipientsTableAdapter.GetDataByIssueID(False, myIssueID)

                         &lt;STRONG&gt;   If fileMetadata.SharingInfo.ParentSharedFolderId IsNot Nothing Then&lt;/STRONG&gt;
                                For Each myIssuee As DataRow In myIssueRecipientsDatatable.Rows
                                    If myIssuee.Item("DREASON").ToString IsNot Nothing Then
                                        myMembers = {New AddMember(New MemberSelector.Email(myIssuee.Item("DREASON").ToString), Nothing)}
                                        Await dbx.Sharing.AddFolderMemberAsync(fileMetadata.SharingInfo.ParentSharedFolderId, myMembers, False, "A Document Issue has been created by " &amp;amp; fnGetCompanyName() &amp;amp; " as you are part of the issue distribution, this ZipFile has been made available to you.")
                                    End If
                                Next
                            End If

                        End If

                        MsgBox("Successfully Uploaded")
                    Else
                        Await dbx.Files.UploadSessionAppendV2Async(cursor, False, memStream)
                    End If
                End If
            End Using
        Next
    End Function&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:09:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305041#M18399</guid>
      <dc:creator>solsupp</dc:creator>
      <dc:date>2019-05-29T09:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305146#M18405</link>
      <description>&lt;P&gt;First, to clarify when you say "Errors on bold text", do you mean you get an actual error on that 'If fileMetadata.SharingInfo.ParentSharedFolderId IsNot Nothing' line? If so, please share the full error output.&lt;/P&gt;
&lt;P&gt;If not, do you mean that the line just doesn't return the value you expect?&amp;nbsp;In that case, what is the SharingInfo value? Note that&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Files_FileMetadata_SharingInfo.htm" target="_self"&gt;FileMetadata.SharingInfo&lt;/A&gt;&amp;nbsp;will only be set "if this file is contained in a shared folder".&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;a&amp;nbsp;folder is not already shared, you need to share it using&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ShareFolderAsync_1.htm" target="_blank"&gt;ShareFolder&lt;/A&gt; before you can add members.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 16:14:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305146#M18405</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-24T16:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305273#M18408</link>
      <description>&lt;P&gt;HI Sorry for not explainging.&lt;/P&gt;&lt;P&gt;I am looking to get ParentSharedFolderId once the above function has completed.&lt;/P&gt;&lt;P&gt;I was using and was able to get ParentSharedFolderID,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;old Code for smaller uploads&lt;/STRONG&gt;&lt;BR /&gt;Dim updated As Task(Of FileMetadata)
                    updated = dbx.Files.UploadAsync((filePath + ("/" + fileName)), WriteMode.Overwrite.Instance, body:=fs)
                     dbx.Sharing.ShareFolderAsync(filePath, Nothing, True)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but for larger data the funtion is now async and using awaits, how can I get ParentSharedFolderID, the larger function I first mentoned above returns "instance not set to an instance of an object"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 22:39:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305273#M18408</guid>
      <dc:creator>solsupp</dc:creator>
      <dc:date>2018-10-24T22:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305274#M18409</link>
      <description>&lt;P&gt;I suppose what im asking is how can I get a result from this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  Private Async Function Uploadfolder(localPath As String, remotePath As String, dbx As DropboxClient, filepath As String) As Task
        Const ChunkSize As Integer = 4096 * 1024


        Using FileStream = File.Open(localPath, FileMode.Open, FileAccess.Read)
            If FileStream.Length &amp;lt;= ChunkSize Then
                Await dbx.Files.UploadAsync(remotePath, WriteMode.Overwrite.Instance, body:=FileStream)
            Else
                Await ChunkUpload(remotePath, FileStream, ChunkSize, dbx, filepath)
            End If

        End Using
    End Function&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Oct 2018 22:42:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305274#M18409</guid>
      <dc:creator>solsupp</dc:creator>
      <dc:date>2018-10-24T22:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305467#M18425</link>
      <description>&lt;P&gt;When you say the error was "&lt;SPAN&gt;instance not set to an instance of an object", did you actually mean "Object&amp;nbsp;instance not set to an instance of an object"? (I.e., did you accidentally drop the first word from the error?)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If so, that would seem to indicate that you have a null reference. If it's coming from the line you indicated earlier, it's probably because&amp;nbsp;fileMetadata or fileMetadata.SharingInfo is null. Note that&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Files_FileMetadata_SharingInfo.htm" target="_self" rel="nofollow noopener noreferrer"&gt;FileMetadata.SharingInfo&lt;/A&gt;&amp;nbsp;will only be set "if this file is contained in a shared folder". Make sure you check the variable before trying to access one that may be null.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the folder you want to share is not yet shared, you can share it using&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ShareFolderAsync_1.htm" target="_blank"&gt;ShareFolderAsync&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyway,&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_UploadAsync_1.htm" target="_blank"&gt;UploadAsync&lt;/A&gt; and&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_UploadSessionFinishAsync.htm" target="_blank"&gt;UploadSessionFinishAsync&lt;/A&gt;&amp;nbsp;have the same return&amp;nbsp;type (Task&amp;lt;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_Files_FileMetadata.htm" target="_self"&gt;FileMetadata&lt;/A&gt;&amp;gt;) so you can use them the same way. I can't provide help with Visual Basic itself, and exactly how you choose to pass data around your methods in your code is up to you of course.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 19:38:21 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/305467#M18425</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-25T19:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306023#M18441</link>
      <description>&lt;P&gt;Seems to be this line that returns the NULL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Dim fileMetadata As FileMetadata = Await dbx.Files.UploadSessionFinishAsync(cursor, New CommitInfo(path), memStream)&lt;/PRE&gt;&lt;P&gt;Is there any other way I can check this file has been uploaded to the shared folder in order to add folder members.&lt;/P&gt;&lt;P&gt;I pass the filemetadata to : in order to add folder members, this works with smaller upload, but fails with larger&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dbx.Sharing.AddFolderMemberAsync(&lt;STRONG&gt;metadata.SharingInfo.ParentSharedFolderId&lt;/STRONG&gt;, myMembers, False, "A Document Issue has been created by " &amp;amp; fnGetCompanyName() &amp;amp; " as you are part of the issue distribution, this ZipFile has been made available to you.")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 10:14:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306023#M18441</guid>
      <dc:creator>solsupp</dc:creator>
      <dc:date>2018-10-29T10:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306110#M18448</link>
      <description>&lt;P&gt;What do you mean when you say it "seems to be this line that returns the NULL"? &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_UploadSessionFinishAsync.htm" target="_blank"&gt;The&amp;nbsp;UploadSessionFinishAsync method&lt;/A&gt;&amp;nbsp;either returns&amp;nbsp;&lt;A href="http://msdn2.microsoft.com/en-us/library/dd321424" target="_blank"&gt;Task&lt;/A&gt;&amp;lt;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_Files_FileMetadata.htm" target="_blank"&gt;FileMetadata&lt;/A&gt;&amp;gt;, or raises an exception. Please add extra logging or use a debugger to confirm what is actually being returned or raised.&lt;/P&gt;
&lt;P&gt;Anyway,&amp;nbsp;UploadSessionFinishAsync is the correct way to commit and then&amp;nbsp;receive the metadata for a large file upload.&lt;/P&gt;
&lt;P&gt;Please note that&amp;nbsp;SharingInfo is not guaranteed to be set. It is only set if the&amp;nbsp;file is in a shared folder. You should check&amp;nbsp;metadata.SharingInfo before trying to use&amp;nbsp;metadata.SharingInfo.ParentSharedFolderId. More logging or a debugger would likely be helpful here as well.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;Different files can be located in different folders, so it's possible one happens to be in a shared folder, and one isn't.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you uploaded the file to a folder&amp;nbsp;that is not yet shared, you can share ithe folder using&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ShareFolderAsync_1.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;ShareFolderAsync&lt;/A&gt;&amp;nbsp;first.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 17:56:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306110#M18448</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-29T17:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306137#M18453</link>
      <description>&lt;P&gt;Have also tried that which works, just cant get parentshartedfolderID from this task.&lt;/P&gt;&lt;PRE&gt;  Dim updated As Task(Of ShareFolderLaunch)
                    updated = dbx.Sharing.ShareFolderAsync(filePath, Nothing, True)&lt;/PRE&gt;&lt;P&gt;Once the folder is shared, I just want to add folder members.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 20:38:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306137#M18453</guid>
      <dc:creator>solsupp</dc:creator>
      <dc:date>2018-10-29T20:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306324#M18460</link>
      <description>&lt;P&gt;In this latest snippet of code, I see you're using&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ShareFolderAsync_1.htm" target="_blank"&gt;ShareFolderAsync&lt;/A&gt;. Since that call is to share a folder itself, it doesn't have&amp;nbsp;ParentSharedFolderId like files in shared folders do.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ShareFolderAsync_1.htm" target="_blank"&gt;ShareFolderAsync&lt;/A&gt;&amp;nbsp;returns&amp;nbsp;&lt;A href="http://msdn2.microsoft.com/en-us/library/dd321424" target="_blank"&gt;Task&lt;/A&gt;&amp;lt;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_Sharing_ShareFolderLaunch.htm" target="_blank"&gt;ShareFolderLaunch&lt;/A&gt;&amp;gt;. You should use&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_CheckShareJobStatusAsync.htm" target="_blank"&gt;CheckShareJobStatusAsync&lt;/A&gt;&amp;nbsp;to check the status after calling ShareFolderAsync.&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_CheckShareJobStatusAsync.htm" target="_blank"&gt;CheckShareJobStatusAsync&lt;/A&gt;&amp;nbsp;returns &lt;A href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1?redirectedfrom=MSDN&amp;amp;view=netframework-4.7.2" target="_self"&gt;Task&lt;/A&gt;&amp;lt;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_Sharing_ShareFolderJobStatus.htm" target="_blank"&gt;ShareFolderJobStatus&lt;/A&gt;&amp;gt;. If &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Sharing_ShareFolderJobStatus_IsComplete.htm" target="_blank"&gt;ShareFolderJobStatus.IsComplete&lt;/A&gt;, you can use&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Sharing_ShareFolderJobStatus_AsComplete.htm" target="_blank"&gt;ShareFolderJobStatus.AsComplete&lt;/A&gt;&amp;nbsp;to get the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Sharing_SharedFolderMetadata_SharedFolderId.htm" target="_blank"&gt;SharedFolderMetadata.SharedFolderId&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 18:13:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306324#M18460</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-30T18:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306453#M18466</link>
      <description>&lt;P&gt;OK, getting a bit further now, what if I already have a shared folder that exists, I get the exception&amp;nbsp;"bad_path/already_shared", can I check if a folder share already exists?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 23:17:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306453#M18466</guid>
      <dc:creator>solsupp</dc:creator>
      <dc:date>2018-10-30T23:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Large Data Upload</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306620#M18472</link>
      <description>&lt;P&gt;Making the call and catching that exception is fine, but if you want to check beforehand, you can call&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_GetMetadataAsync_1.htm" target="_blank"&gt;FilesUserRoutes.GetMetadataAsync&lt;/A&gt; for the folder itself and check the returned&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Files_FolderMetadata_SharingInfo.htm" target="_blank"&gt;FolderMetadata.SharingInfo&lt;/A&gt;. (Or, you can list all of the shared folders on the account using&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ListFoldersAsync_1.htm" target="_blank"&gt;SharingUserRoutes.ListFoldersAsync&lt;/A&gt;/&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ListFoldersContinueAsync_1.htm" target="_blank"&gt;SharingUserRoutes.ListFoldersContinueAsync&lt;/A&gt;.)&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 14:30:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Large-Data-Upload/m-p/306620#M18472</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-31T14:30:27Z</dc:date>
    </item>
  </channel>
</rss>

