<?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: Uploading multiple files with UploadSession with TypeScript in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/400085#M21901</link>
    <description>&lt;P&gt;Thank you, for your reply it does work as a workaround. Can you please keep me informed when this is fixed ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 07:16:50 GMT</pubDate>
    <dc:creator>DavidM27</dc:creator>
    <dc:date>2020-03-02T07:16:50Z</dc:date>
    <item>
      <title>Uploading multiple files with UploadSession with TypeScript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/399797#M21878</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm facing an issue with the UploadSessionFinishBatch method with TypeScript.&lt;/P&gt;&lt;P&gt;I'm having this error :&lt;/P&gt;&lt;PRE&gt;Error in call to API function \"files/upload_session/finish_batch\": request body: entries: unknown field 'contents&lt;/PRE&gt;&lt;P&gt;It seems like the "contents" parameter is not supposed to be here and makes the call crash. But in TypeScript the contents is required.&lt;/P&gt;&lt;P&gt;In some example I found on the web I've never seen the contents parameter. Is it a problem of type due to TypeScript SDK ? Or there is something I miss ?&lt;/P&gt;&lt;P&gt;Here is the code I use&lt;/P&gt;&lt;PRE&gt;const finishUploadBatchArg: DropboxTypes.files.UploadSessionFinishBatchArg = {
      entries: [],
    }

// For each file I do : 
const response = await this.dropBox.filesUploadSessionStart(uploadSessionStartArg)
        sessionId = response.session_id
        const cursor: DropboxTypes.files.UploadSessionCursor = {
          contents: file,
          offset:file.size,
          session_id: sessionId,
        }
        const commitInfo: DropboxTypes.files.CommitInfo = {
          contents: file,
          path: filePath,
          autorename: true,
        }

        const finishSessionArg = {
          contents : file, //This one is unknown from what I understand of the error I get
          cursor: cursor,
          commit: commitInfo,
        }
        finishUploadBatchArg.entries.push(finishSessionArg)
//Then I call the finish batch method : 
const response: DropboxTypes.files.UploadSessionFinishBatchLaunch = await this.dropBox.filesUploadSessionFinishBatch(finishUploadBatchArg)&lt;/PRE&gt;&lt;P&gt;By the way all the session start goes well.&lt;/P&gt;&lt;P&gt;Can you please help me on this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 14:44:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/399797#M21878</guid>
      <dc:creator>DavidM27</dc:creator>
      <dc:date>2020-02-28T14:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading multiple files with UploadSession with TypeScript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/399870#M21888</link>
      <description>&lt;P&gt;Thanks for writing this up! This does seem to be a bug in the SDK. The&amp;nbsp;UploadSessionFinishArg type has a 'contents' field&amp;nbsp;because it's how you supply the data if/when calling&amp;nbsp;filesUploadSessionFinish (not the batch version), where it gets set as the request body, but it's not actually needed or expected for&amp;nbsp;filesUploadSessionFinishBatch. I'll ask the team to fix this up.&lt;/P&gt;
&lt;P&gt;Similarly, in this case you should just be setting the file data on&amp;nbsp;UploadSessionStartArg itself, not&amp;nbsp;UploadSessionCursor or&amp;nbsp;CommitInfo. Those definitions are also wrong, so I'll ask the team to fix that too.&lt;/P&gt;
&lt;P&gt;As a workaround though, it looks like you can do the following after defining each of these:&lt;/P&gt;
&lt;PRE&gt;delete cursor.contents
delete commitInfo.contents
delete finishSessionArg.contents&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 21:59:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/399870#M21888</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-02-28T21:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading multiple files with UploadSession with TypeScript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/400085#M21901</link>
      <description>&lt;P&gt;Thank you, for your reply it does work as a workaround. Can you please keep me informed when this is fixed ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 07:16:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/400085#M21901</guid>
      <dc:creator>DavidM27</dc:creator>
      <dc:date>2020-03-02T07:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading multiple files with UploadSession with TypeScript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/400237#M21906</link>
      <description>&lt;P&gt;Yes, I'll follow up here once I have an update on this. I can't promise when that will be though.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 19:26:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/400237#M21906</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-03-02T19:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading multiple files with UploadSession with TypeScript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/518906#M25355</link>
      <description>&lt;P&gt;The team has updated the SDK to no longer set 'contents' as required in the latest JavaScript SDK version, v9.7.0, so you should be able to use this as expected without the workaround now.&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 21:21:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-multiple-files-with-UploadSession-with-TypeScript/m-p/518906#M25355</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-05-07T21:21:57Z</dc:date>
    </item>
  </channel>
</rss>

