<?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 Renaming a file is creating a copy in dropbox .NET SDK in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/583771#M27190</link>
    <description>&lt;P&gt;When i try to rename file i see in dropbox a copy being created rather than just a name change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how i am trying to achieve this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;using (var dbx = new DropboxClient(RefreshToken,Appkey,Appsecret))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var updated = await dbx.Files.UploadAsync(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"/" + remoteUrl,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;mode:WriteMode.Overwrite.Instance,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;body: fileStream);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;remoteUrl: dropbox folder path. Ex: /Backup/Notes/&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I have specified writemode as overwrite but still a duplicate is getting created rather than just renaming. Is there any way to handle this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2022 12:42:33 GMT</pubDate>
    <dc:creator>SuryaMopuru</dc:creator>
    <dc:date>2022-04-27T12:42:33Z</dc:date>
    <item>
      <title>Renaming a file is creating a copy in dropbox .NET SDK</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/583771#M27190</link>
      <description>&lt;P&gt;When i try to rename file i see in dropbox a copy being created rather than just a name change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how i am trying to achieve this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;using (var dbx = new DropboxClient(RefreshToken,Appkey,Appsecret))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var updated = await dbx.Files.UploadAsync(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"/" + remoteUrl,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;mode:WriteMode.Overwrite.Instance,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;body: fileStream);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;remoteUrl: dropbox folder path. Ex: /Backup/Notes/&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I have specified writemode as overwrite but still a duplicate is getting created rather than just renaming. Is there any way to handle this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 12:42:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/583771#M27190</guid>
      <dc:creator>SuryaMopuru</dc:creator>
      <dc:date>2022-04-27T12:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a file is creating a copy in dropbox .NET SDK</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/583774#M27191</link>
      <description>&lt;P&gt;The UploadAsync method is for uploading a file (whether a new file or a new version of an existing file). If you want to rename an existing file you should use &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_MoveV2Async_1.htm" target="_self"&gt;MoveV2Async&lt;/A&gt; instead. That takes a fromPath for the existing path (including file name) of the existing file to move or rename, and toPath for the new path (including file name) that you want the file to have instead.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 17:36:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/583774#M27191</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-03-15T17:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a file is creating a copy in dropbox .NET SDK</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/584494#M27208</link>
      <description>&lt;P&gt;How can i distinguish between rename and duplicate. Currently this is how i am trying to do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;using (var dbx = new DropboxClient(RefreshToken, Appkey, Appsecret))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;try&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var metadata = (await dbx.Files.GetMetadataAsync("/" + backupItem.Path));&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if (metadata != null)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var remote = "/" + remoteUrl;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var fromPath = "/" + backupItem.Path;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;RelocationResult result = await dbx.Files.MoveV2Async(fromPath, remote);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(result != null)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var updated = await dbx.Files.UploadAsync(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"/" + remoteUrl,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;mode: WriteMode.Overwrite.Instance,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;body: fileStream);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;catch &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var updated = await dbx.Files.UploadAsync(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"/" + remoteUrl,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;mode: WriteMode.Overwrite.Instance,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;body: fileStream);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i try to rename it is working because moveasync will get invoked but when i try to duplicate the file it is updating the existing file rather than duplicating it. Do we have any way to handle my scenario.&lt;/P&gt;&lt;P&gt;For the first time when user creates any file our GetMetadatAsync will throw an error because in the mentioned path we dont have file so it goes into catch block and upload the new file.&lt;/P&gt;&lt;P&gt;This should happen in duplication also.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 12:21:30 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/584494#M27208</guid>
      <dc:creator>SuryaMopuru</dc:creator>
      <dc:date>2022-03-18T12:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a file is creating a copy in dropbox .NET SDK</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/584536#M27211</link>
      <description>&lt;P&gt;I see you also opened &lt;A href="https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/td-p/584499" target="_self"&gt;a new thread for this&lt;/A&gt;, so I'll follow up with you there.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 15:28:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Renaming-a-file-is-creating-a-copy-in-dropbox-NET-SDK/m-p/584536#M27211</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-03-18T15:28:28Z</dc:date>
    </item>
  </channel>
</rss>

