You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

DavidM27's avatar
DavidM27
Explorer | Level 4
5 years ago

Uploading multiple files with UploadSession with TypeScript

Hi, I'm facing an issue with the UploadSessionFinishBatch method with TypeScript. I'm having this error : Error in call to API function \"files/upload_session/finish_batch\": request body: entries...
  • Greg-DB's avatar
    5 years ago

    Thanks for writing this up! This does seem to be a bug in the SDK. The UploadSessionFinishArg type has a 'contents' field because it's how you supply the data if/when calling filesUploadSessionFinish (not the batch version), where it gets set as the request body, but it's not actually needed or expected for filesUploadSessionFinishBatch. I'll ask the team to fix this up.

    Similarly, in this case you should just be setting the file data on UploadSessionStartArg itself, not UploadSessionCursor or CommitInfo. Those definitions are also wrong, so I'll ask the team to fix that too.

    As a workaround though, it looks like you can do the following after defining each of these:

    delete cursor.contents
    delete commitInfo.contents
    delete finishSessionArg.contents