<?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: What String to use in writemode update in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380664#M21257</link>
    <description>&lt;P&gt;Using the "&lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/Files/WriteMode.html#/s:13SwiftyDropbox5FilesC9WriteModeO6updateyAESScAEmF" target="_self"&gt;update&lt;/A&gt;" mode is safer, and so it is recommended. The value you supply in it should be the "rev" value for the version of the file that you last downloaded and are updating, so that the server knows if you are working from the latest version or not.&lt;/P&gt;
&lt;P&gt;You can get the rev value from&amp;nbsp;&lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/Files/FileMetadata.html#/s:13SwiftyDropbox5FilesC12FileMetadataC3revSSvp" target="_self"&gt;FileMetadata.rev&lt;/A&gt;, e.g., as returned by the &lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/FilesRoutes.html#/s:13SwiftyDropbox11FilesRoutesC8download4path3rev9overwrite11destinationAA19DownloadRequestFileCyAA0C0C0L18MetadataSerializerCAL0j5ErrorN0CGSS_SSSgSb10Foundation3URLVAU_So17NSHTTPURLResponseCtctF" target="_self"&gt;download&lt;/A&gt; method.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2019 14:29:40 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2019-11-25T14:29:40Z</dc:date>
    <item>
      <title>What String to use in writemode update</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380423#M21250</link>
      <description>&lt;P&gt;My goal is to use SwiftyDropbox in my Swift iOS app to save the user's data and keep it synced between devices. I did this successfully by first deleting the existing file and then writing the updated file, but I would like to use the writemode update instead as that seems safer and better. The one thing I can't figure out is what String to use in the call mode: .update(String). I tried using the same string as the path and that resulted in an error.&lt;/P&gt;
&lt;P&gt;I hope this isn't a dumb question, but I've spent the last hour scouring google, the documention, and this forum and I can't seem to find this answer.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;PRE&gt;let encodedCompleteLibrary = try? JSONEncoder().encode(completeLibrary)
        
        if _inDropboxSyncMode, let client = DropboxClientsManager.authorizedClient {
            if let fileData = encodedCompleteLibrary {
                let pathString: String = UserDefaultsKeys.dropboxFolderName + UserDefaultsKeys.completeLibraryFilename
                client.files.upload(path: pathString, mode: .update(?????), autorename: false, mute: false, input: fileData)
                .response { response, error in
                    if let response = response {
                        self._inOfflineMode = false
                        print(response)
                    } else if let error = error {
                        self._inOfflineMode = true
                        print(error)
                    }
                }
            }&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Dec 2019 19:59:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380423#M21250</guid>
      <dc:creator>chrismcqueen</dc:creator>
      <dc:date>2019-12-26T19:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: What String to use in writemode update</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380664#M21257</link>
      <description>&lt;P&gt;Using the "&lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/Files/WriteMode.html#/s:13SwiftyDropbox5FilesC9WriteModeO6updateyAESScAEmF" target="_self"&gt;update&lt;/A&gt;" mode is safer, and so it is recommended. The value you supply in it should be the "rev" value for the version of the file that you last downloaded and are updating, so that the server knows if you are working from the latest version or not.&lt;/P&gt;
&lt;P&gt;You can get the rev value from&amp;nbsp;&lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/Files/FileMetadata.html#/s:13SwiftyDropbox5FilesC12FileMetadataC3revSSvp" target="_self"&gt;FileMetadata.rev&lt;/A&gt;, e.g., as returned by the &lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/FilesRoutes.html#/s:13SwiftyDropbox11FilesRoutesC8download4path3rev9overwrite11destinationAA19DownloadRequestFileCyAA0C0C0L18MetadataSerializerCAL0j5ErrorN0CGSS_SSSgSb10Foundation3URLVAU_So17NSHTTPURLResponseCtctF" target="_self"&gt;download&lt;/A&gt; method.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 14:29:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380664#M21257</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-11-25T14:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: What String to use in writemode update</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380718#M21263</link>
      <description>&lt;P&gt;Awesome, thank you! I kept seeing "rev" and not knowing what that reffered to. I will give that a shot.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 18:01:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380718#M21263</guid>
      <dc:creator>chrismcqueen</dc:creator>
      <dc:date>2019-11-25T18:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: What String to use in writemode update</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380739#M21264</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Using the "&lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/Files/WriteMode.html#/s:13SwiftyDropbox5FilesC9WriteModeO6updateyAESScAEmF" target="_self"&gt;update&lt;/A&gt;" mode is safer, and so it is recommended. The value you supply in it should be the "rev" value for the version of the file that you last downloaded and are updating, so that the server knows if you are working from the latest version or not.&lt;/P&gt;&lt;P&gt;You can get the rev value from&amp;nbsp;&lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/Files/FileMetadata.html#/s:13SwiftyDropbox5FilesC12FileMetadataC3revSSvp" target="_self"&gt;FileMetadata.rev&lt;/A&gt;, e.g., as returned by the &lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/FilesRoutes.html#/s:13SwiftyDropbox11FilesRoutesC8download4path3rev9overwrite11destinationAA19DownloadRequestFileCyAA0C0C0L18MetadataSerializerCAL0j5ErrorN0CGSS_SSSgSb10Foundation3URLVAU_So17NSHTTPURLResponseCtctF" target="_self"&gt;download&lt;/A&gt; method.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 19:42:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-String-to-use-in-writemode-update/m-p/380739#M21264</guid>
      <dc:creator>familyparker8</dc:creator>
      <dc:date>2019-11-25T19:42:46Z</dc:date>
    </item>
  </channel>
</rss>

