<?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: Too Many Write Operations when Uploading Files in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/567870#M26607</link>
    <description>&lt;P&gt;That's correct, thanks and happy new year &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;!&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jan 2022 15:31:54 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2022-01-03T15:31:54Z</dc:date>
    <item>
      <title>Too Many Write Operations when Uploading Files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/565214#M26546</link>
      <description>&lt;P&gt;Hello &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting too_many_write_operations/ at times while uploading a hierarchy of folders each containing a single file.&lt;BR /&gt;I am using the UploadSessionStartAsync, UploadSessionAppendV2Async, UploadSessionFinishAsync and UploadAsync APIs to upload files using fragment buffer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes all the files get uploaded correctly but in some test runs some files do not get uploaded due to too_many_write_operations error.&amp;nbsp;How do I prevent "too_many_write_operations/" error ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error Message:&lt;/STRONG&gt;&lt;BR /&gt;PathDisplay: /Sandy_Source/Starting folder/SUB1/SUB2/SUB3/SUB4/TriggeredAlarm_Service_Log.txt&lt;BR /&gt;Retry Count: 1&lt;BR /&gt;too_many_write_operations/...&lt;BR /&gt;at Dropbox.Api.DropboxRequestHandler.&amp;lt;RequestJsonString&amp;gt;d__20.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at Dropbox.Api.DropboxRequestHandler.&amp;lt;RequestJsonStringWithRetry&amp;gt;d__18.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at Dropbox.Api.DropboxRequestHandler.&amp;lt;Dropbox-Api-Stone-ITransport-SendUploadRequestAsync&amp;gt;d__13`3.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()&lt;BR /&gt;at SyncPro.Adapters.Dropbox.DropboxClient.&amp;lt;SendUploadFragment&amp;gt;d__49.MoveNext()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Sample S&lt;/STRONG&gt;&lt;STRONG&gt;ource Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public async Task SendUploadFragment(DropboxUploadSession uploadSession, byte[] fragmentBuffer, long offset)
{
for (int i = 1; i &amp;lt;= retry; i++)
{
try
{
teamclient = new DropboxApi.DropboxTeamClient(this.CurrentToken.RefreshToken, appkey, appsecret);

DropboxApi.DropboxClient clientadmin = teamclient.AsMember(this.UserProfile.TeamMemberId);

using (var memStream = new MemoryStream(fragmentBuffer, 0, fragmentBuffer.Length))
{
if (String.IsNullOrEmpty(uploadSession.SessionId))
{
if (!uploadSession.islastfragment)
{
UploadSessionStartArg args = new UploadSessionStartArg();
var result = await clientadmin.Files.UploadSessionStartAsync(args, memStream);
uploadSession.SessionId = result.SessionId;
}
else
{
FileMetadata fileMetadata = null;

try
{
fileMetadata = await clientadmin.Files.UploadAsync(new CommitInfo(uploadSession.Item.PathDisplay), memStream);
break;
}
catch (Exception ex)
{
if (ex is DropboxApi.RateLimitException)
{
Thread.Sleep(((DropboxApi.RateLimitException)ex).RetryAfter * 1000);
}
}
}
}
else
{
var cursor = new UploadSessionCursor(uploadSession.SessionId, (ulong)offset);

if (uploadSession.islastfragment)
{
FileMetadata fileMetadata = null;
try
{
fileMetadata = await clientadmin.Files.UploadSessionFinishAsync(cursor, new CommitInfo(uploadSession.Item.PathDisplay), memStream);
break;
}
catch (Exception ex)
{
if (ex is DropboxApi.RateLimitException)
{
Thread.Sleep(((DropboxApi.RateLimitException)ex).RetryAfter * 1000);
}
}
}
}
else
{
try
{
await clientadmin.Files.UploadSessionAppendV2Async(cursor, false, memStream);
break;
}
catch (Exception ex)
{
if (ex is DropboxApi.RateLimitException)
{
Thread.Sleep(((DropboxApi.RateLimitException)ex).RetryAfter * 1000);
}
}
}
}
}
break;
}
catch (Exception ex)
{
if (ex is DropboxApi.RateLimitException)
{
Thread.Sleep(((DropboxApi.RateLimitException)ex).RetryAfter * 1000);
}

if (i == retry)
{
throw ex;
}
}
}
}
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gagan&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 16:17:53 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/565214#M26546</guid>
      <dc:creator>gagsbh</dc:creator>
      <dc:date>2021-12-20T16:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Too Many Write Operations when Uploading Files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/565272#M26548</link>
      <description>&lt;P&gt;If you're making multiple changes at the same time in the same account or shared folder, you can run in to this 'too_many_write_operations' error, which is "lock contention".&amp;nbsp;That's not explicit rate limiting, but rather a result of how Dropbox works on the back-end. This is a technical inability to make a modification in the account or shared folder at the time of the API call. This error indicates that there was simultaneous activity in the account or shared/team folder preventing your app from making the state-modifying call (e.g., adding, editing, moving, copying, sharing, or deleting files/folders) it is attempting. The simultaneous activity could be coming from your app itself, or elsewhere, e.g., from the user's desktop client. It can come from the same user, or another member of a shared folder. You can find &lt;A href="https://developers.dropbox.com/dbx-performance-guide" rel="noreferrer" target="_blank"&gt;more information about lock contention here&lt;/A&gt;. The app will need to be written to automatically handle this error.&lt;BR /&gt;&lt;BR /&gt;In short, to avoid this error, you should avoid making multiple concurrent state modifications and use batch endpoints where possible, such as &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_UploadSessionFinishBatchAsync_1.htm" target="_self"&gt;UploadSessionFinishBatchAsync&lt;/A&gt;. That won't guarantee that you won't run in to this error though, as contention can still come from other sources, so you should also implement error handling and automatic retrying as needed.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 20:51:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/565272#M26548</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-12-20T20:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Too Many Write Operations when Uploading Files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/565339#M26549</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;for the information&lt;/P&gt;&lt;P&gt;I will look into my code and let you know if I have any more queries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gagan&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 03:51:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/565339#M26549</guid>
      <dc:creator>gagsbh</dc:creator>
      <dc:date>2021-12-21T03:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Too Many Write Operations when Uploading Files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/567816#M26603</link>
      <description>&lt;P&gt;Hello &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I reviewed my code and found that multiple concurrent threads were trying to upload files that was causing "too_many_writes" error.&lt;BR /&gt;Once I made the uploads serial, the issue got resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to make the upload of several files happen is parallel so I like to implement "UploadSessionFinishBatchAsync".&lt;BR /&gt;I use the following APIs:&lt;BR /&gt;- UploadSessionStartAsync that takes memory stream as parameter:&lt;BR /&gt;&amp;nbsp; clientadmin.Files.UploadSessionStartAsync(args, memStream);&lt;BR /&gt;- UploadSessionAppendV2Async that also takes memory stream as parameter:&lt;BR /&gt;&amp;nbsp; clientadmin.Files.UploadSessionAppendV2Async(cursor, false, memStream);&lt;BR /&gt;- UploadSessionFinishAsync that also takes memory stream as parameter:&lt;BR /&gt;&amp;nbsp; clientadmin.Files.UploadSessionFinishAsync(cursor, new CommitInfo(Item.PathDisplay), memStream);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case most of the files are small in size and the memory stream is used completely in UploadSessionStartAsync(args, memStream), then what do I pass in memstream parameter in clientadmin.Files.UploadSessionFinishAsync(cursor, new CommitInfo(Item.PathDisplay), memStream);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words, in case of single fragment for small files, can I use UploadSessionStartAsync.&lt;BR /&gt;If yes, what do I pass for memory stream parameter when I end session with UploadSessionFinishAsync API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I cannot use UploadSessionStartAsync for single fragment small files then I need to use UploadAsync API to upload small files.&lt;BR /&gt;How can I use "UploadSessionFinishBatchAsync" with clientadmin.Files.UploadAsync(new CommitInfo(item.PathDisplay), memStream).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean how do I prevent "too_many_write" error while uploading multiple files concurrently in case I have to use UploadAsync API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Gagan&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 12:04:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/567816#M26603</guid>
      <dc:creator>gagsbh</dc:creator>
      <dc:date>2022-01-03T12:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Too Many Write Operations when Uploading Files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/567847#M26604</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/668778"&gt;@gagsbh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;I would like to make the upload of several files happen is parallel so &lt;STRONG&gt;I like to implement "UploadSessionFinishBatchAsync"&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;In case most of the files are small in size and the memory stream is used completely in UploadSessionStartAsync(args, memStream), then &lt;STRONG&gt;what do I pass in memstream parameter in clientadmin.Files.UploadSessionFinishAsync(cursor, new CommitInfo(Item.PathDisplay), memStream)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/668778"&gt;@gagsbh&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Happy New Year. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;Seems you are mixing different ideas! When you are using UploadSessionFinishAsync, a big file is going to be upload and put in Dropbox namespace at the end. After this call, upload session is closed and can't be used (there is no reason for such use actually); the file upload has finished. For multiple files upload with multiple upload sessions, instead of UploadSessionFinishAsync you can use UploadSessionFinishBatchAsync to finish all sessions at once, not one by one, so contentions appearing becomes less likely.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/668778"&gt;@gagsbh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;In other words, in case of single fragment for small files, can I use UploadSessionStartAsync.&lt;BR /&gt;If yes, what do I pass for memory stream parameter when I end session with UploadSessionFinishAsync API.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, you can use UploadSessionStartAsync. Even more it's mandatory. Do you know other way to start upload session?! 🧐&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; By the way if you want to use batch mode, as I mentioned above, you haven't to use UploadSessionFinishAsync! It's NOT for use in batch mode!!! UploadSessionFinishBatchAsync&amp;nbsp;UploadSessionFinishAsync are mutually exclusive! &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@A16056C119D4591E1188DE34BB2BEF73/emoticons/1f446.png" alt=":backhand_index_pointing_up:" title=":backhand_index_pointing_up:" /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/668778"&gt;@gagsbh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;If I cannot use UploadSessionStartAsync for single fragment small files then I need to use UploadAsync API to upload small files.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;No, you can use either UploadSessionStartAsync or UploadAsync for small files (less than 150MB). You can't use UploadAsync for large files, where UploadSessionStartAsync can be used only. Just notice that UploadAsync doesn't start session, so can't be used in batch mode!&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/668778"&gt;@gagsbh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;BR /&gt;How can I use "UploadSessionFinishBatchAsync" with clientadmin.Files.UploadAsync(new CommitInfo(item.PathDisplay), memStream).&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You can NOT! As mentioned before, UploadSessionFinishBatchAsync needs set of sessions, but UploadAsync doesn't start any session.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/668778"&gt;@gagsbh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;I mean how do I prevent "too_many_write" error while uploading multiple files concurrently in case I have to use UploadAsync API.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp; has mentioned above, you can't prevent entirely contentions ("too_many_write" error). It's matter to decrease appearance probability! You should be still able handle such a exception; take care for such in your code and be ready. Using UploadAsync is definitely not the way.&lt;/P&gt;&lt;P&gt;For you case (multiple small files) start a session with&amp;nbsp;UploadSessionStartAsync for every file and upload it on start together with closing that uploads (use the corresponding flag). After you have all files sessions use them in a single UploadSessionFinishBatchAsync call.&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; That's it. Instead multiple finishing for every single file, will be just a single one for all files in the set.&lt;/P&gt;&lt;P&gt;Hope this clarifies matter.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 14:44:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/567847#M26604</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-01-03T14:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Too Many Write Operations when Uploading Files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/567870#M26607</link>
      <description>&lt;P&gt;That's correct, thanks and happy new year &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 15:31:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/567870#M26607</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-01-03T15:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Too Many Write Operations when Uploading Files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/568081#M26613</link>
      <description>&lt;P&gt;Happy New Year to&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp; !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank-you for the clarification.&lt;/P&gt;&lt;P&gt;I now understand that I need to use&amp;nbsp;&lt;SPAN&gt;UploadSessionStartAsync with Close = true instead of UploadAsync.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have another query related to the last fragment call to UploadSessionAppendV2Async&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As I understand, I need to make the last call to&amp;nbsp;UploadSessionAppendV2Async with Close = true parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var cursor = new UploadSessionCursor(uploadSession.SessionId, offset);
await clientadmin.Files.UploadSessionAppendV2Async(cursor, true, memStream);&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Do I using the same cursor as used above while initializing UploadSessionFinishArg ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And do I then add UploadSessionFinishArg to List&amp;lt;UploadSessionFinishArg&amp;gt; as below?&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;UploadSessionFinishArg arg = new UploadSessionFinishArg(cursor, new CommitInfo(uploadSession.Item.PathDisplay));
args.Add(arg);
&lt;/LI-CODE&gt;&lt;P&gt;where&amp;nbsp;args is if type declared globally&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;public List&amp;lt;UploadSessionFinishArg&amp;gt; args = new List&amp;lt;UploadSessionFinishArg&amp;gt;();&lt;/LI-CODE&gt;&lt;P&gt;And, once all upload sessions have been added to args, I call the UploadSessionFinishBatchAsync&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;UploadSessionFinishBatchArg batchArg = new UploadSessionFinishBatchArg(args);
var result = await clientadmin.Files.UploadSessionFinishBatchAsync(batchArg);
if(result != null &amp;amp;&amp;amp; result.AsAsyncJobId != null &amp;amp;&amp;amp; result.AsAsyncJobId.Value != null)
{
return result.AsAsyncJobId.Value;
}
&lt;/LI-CODE&gt;&lt;P&gt;Finally, check if Job is complete and obtain and process FileMetadata Entries&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;UploadSessionFinishBatchJobStatus resultstatus = await clientadmin.Files.UploadSessionFinishBatchCheckAsync();

if (resultstatus.IsComplete)
{
  foreach (var filemetadata in resultstatus.AsComplete.Value.Entries)
  {
    //Process FileMetatData
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since, I did not find a Dot Net SDK sample for the UploadSessionFinishBatchAsync API, I need your feedback on the above steps that I plan to implement for Batch Uploads using "UploadSessionFinishBatchAsync"&amp;nbsp; API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gagan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 12:02:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/568081#M26613</guid>
      <dc:creator>gagsbh</dc:creator>
      <dc:date>2022-01-04T12:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Too Many Write Operations when Uploading Files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/568421#M26624</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/668778"&gt;@gagsbh&lt;/a&gt; You should set close=true on the last call to on upload session where you need to upload data for that upload session. That might actually be on a UploadSessionStartAsync call (for small files), or a UploadSessionAppendV2Async call, or a UploadSessionFinishAsync call, if not using UploadSessionFinishBatchAsync. If you are using UploadSessionFinishBatchAsync, then you do need to set close=true on the last UploadSessionStartAsync or UploadSessionAppendV2Async for that upload session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Every upload session is used to upload one file, and has one upload session ID. So, the cursor for any given upload session should have the upload session ID for that upload session, and an offset that indicates how much has been uploaded so far for that upload session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_UploadSessionFinishBatchAsync_1.htm" target="_self"&gt;UploadSessionFinishBatchAsync&lt;/A&gt; takes an IEnumerable&amp;lt;UploadSessionFinishArg&amp;gt;, which should contain one UploadSessionFinishArg per upload session (each of which needs to be closed) that you wish to finish.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 14:01:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Too-Many-Write-Operations-when-Uploading-Files/m-p/568421#M26624</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-01-05T14:01:58Z</dc:date>
    </item>
  </channel>
</rss>

