<?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: Distinguish between duplicating a file and renaming a file in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584537#M27212</link>
    <description>&lt;P&gt;As in your previous thread, the &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_UploadAsync_1.htm" target="_self"&gt;UploadAsync&lt;/A&gt; 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" rel="nofollow noopener noreferrer"&gt;MoveV2Async&lt;/A&gt; instead.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally, if you want to duplicate, that is, make a copy of, an existing file, you can use &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_CopyV2Async_1.htm" target="_self"&gt;CopyV2Async&lt;/A&gt; instead. Similar to moving a file, that method takes a fromPath for the existing path (including file name) of the existing file you want to copy, and toPath for the new path (including file name) of where you want the new copy of the file to be put.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Mar 2022 15:29:33 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2022-03-18T15:29:33Z</dc:date>
    <item>
      <title>Distinguish between duplicating a file and renaming a file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584499#M27209</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>Wed, 27 Apr 2022 12:42:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584499#M27209</guid>
      <dc:creator>SuryaMopuru</dc:creator>
      <dc:date>2022-04-27T12:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between duplicating a file and renaming a file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584537#M27212</link>
      <description>&lt;P&gt;As in your previous thread, the &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_UploadAsync_1.htm" target="_self"&gt;UploadAsync&lt;/A&gt; 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" rel="nofollow noopener noreferrer"&gt;MoveV2Async&lt;/A&gt; instead.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally, if you want to duplicate, that is, make a copy of, an existing file, you can use &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_CopyV2Async_1.htm" target="_self"&gt;CopyV2Async&lt;/A&gt; instead. Similar to moving a file, that method takes a fromPath for the existing path (including file name) of the existing file you want to copy, and toPath for the new path (including file name) of where you want the new copy of the file to be put.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 15:29:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584537#M27212</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-03-18T15:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between duplicating a file and renaming a file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584548#M27213</link>
      <description>Do we have any way to know that selected file is to duplicate or rename.&lt;BR /&gt;&lt;BR /&gt;Any id or something to know that user has choosen to duplicate the file or to renamw the file</description>
      <pubDate>Fri, 18 Mar 2022 16:29:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584548#M27213</guid>
      <dc:creator>SuryaMopuru</dc:creator>
      <dc:date>2022-03-18T16:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between duplicating a file and renaming a file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584574#M27219</link>
      <description>&lt;P&gt;I'm not sure I follow. Dropbox provides these API calls/methods for performing whatever operations the third party app (your app) needs to perform, but it's up to the third party app to build and show its UI to the end-user, allow them to perform actions and provide input, and use its logic to determine what calls to make and when. So, for example, the user may indicate in your app that they want to move a file, or make a copy of a file, and the app would use the corresponding method accordingly.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 17:37:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Distinguish-between-duplicating-a-file-and-renaming-a-file/m-p/584574#M27219</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-03-18T17:37:00Z</dc:date>
    </item>
  </channel>
</rss>

