<?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: iOS API v2: possible to overwrite files at upload? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199550#M9290</link>
    <description>&lt;P&gt;That woud look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NSString *path = ...
NSData *data = ...
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];

[[client.filesRoutes uploadData:path mode:mode autorename:false clientModified:nil mute:false inputData:data] response:^(DBFILESFileMetadata *metadata, DBFILESUploadError *routeError, DBRequestError *error) {

        if (metadata) {
            NSLog(@"%@\n", metadata);
        } else {
            NSLog(@"%@\n%@\n", routeError, error);
        }

}];&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Dec 2016 15:43:02 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2016-12-27T15:43:02Z</dc:date>
    <item>
      <title>iOS API v2: possible to overwrite files at upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199325#M9263</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm using the&amp;nbsp;o&lt;SPAN&gt;bjective-c SDK for Dropbox API v2 and trying to do something which should be remarkably simple: upload text files to the user's Dropbox folder and if any changes are made to the file on the device, upload those changes.&lt;BR /&gt;&lt;BR /&gt;However, I'm running into a strategic issue wherein the code refuses to overwrite an existing file. So if a user opens a file on their device, makes a change, I want that change to be pushed to their Dropbox. What's the best way to make this happen? I don't see anything about overwriting files for uploads or updating existing documents.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Using the&amp;nbsp;basic upload code currently:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[[[dbclient.filesRoutes uploadData:[NSString stringWithFormat:@"/%@", fileName] inputData:fileData]
              response:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *error)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Is there an easy way to force overwrites? It would be nice to not have to loop through the Dropbox folder and check if the file currently exists before updating it.&lt;BR /&gt;&lt;BR /&gt;What I'd like to do is simply upload the file, and if it already exists just overwrite it. Is this not possible? Am I going about this incorrectly?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:27:23 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199325#M9263</guid>
      <dc:creator>tannchri</dc:creator>
      <dc:date>2019-05-29T09:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: iOS API v2: possible to overwrite files at upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199328#M9264</link>
      <description>*moves to API forum*</description>
      <pubDate>Fri, 23 Dec 2016 18:41:07 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199328#M9264</guid>
      <dc:creator>Mark</dc:creator>
      <dc:date>2016-12-23T18:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: iOS API v2: possible to overwrite files at upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199334#M9265</link>
      <description>Thanks! Don't know how I got lost here.</description>
      <pubDate>Fri, 23 Dec 2016 18:49:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199334#M9265</guid>
      <dc:creator>tannchri</dc:creator>
      <dc:date>2016-12-23T18:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: iOS API v2: possible to overwrite files at upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199350#M9268</link>
      <description>&lt;P&gt;You can certainly overwrite files using the API. For example, use -&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESRoutes.html#/c:objc(cs)DBFILESRoutes(im)uploadData:mode:autorename:clientModified:mute:inputData:" target="_self"&gt;uploadData:mode:autorename:clientModified:mute:inputData:&lt;/A&gt;&amp;nbsp;and pass in the desired 'mode' parameter, which should be a &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESWriteMode.html" target="_self"&gt;DBFILESWriteMode&lt;/A&gt;. You can use the 'overwrite' mode, but using 'update' with a rev value is safer, as it prevents accidentally overwriting new data the app wasn't aware of.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 21:24:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199350#M9268</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-12-23T21:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: iOS API v2: possible to overwrite files at upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199509#M9280</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Though I'm still having trouble with this, and am unable to find any resolution elsewhere. Is this not the correct way to write this? "&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;dbclient&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;filesRoutes&lt;/SPAN&gt; &lt;SPAN&gt;uploadData&lt;/SPAN&gt;&lt;SPAN&gt;:fileName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;mode&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;DBFILESWriteModeOverwrite ..."&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 01:45:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199509#M9280</guid>
      <dc:creator>tannchri</dc:creator>
      <dc:date>2016-12-27T01:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: iOS API v2: possible to overwrite files at upload?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199550#M9290</link>
      <description>&lt;P&gt;That woud look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NSString *path = ...
NSData *data = ...
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];

[[client.filesRoutes uploadData:path mode:mode autorename:false clientModified:nil mute:false inputData:data] response:^(DBFILESFileMetadata *metadata, DBFILESUploadError *routeError, DBRequestError *error) {

        if (metadata) {
            NSLog(@"%@\n", metadata);
        } else {
            NSLog(@"%@\n%@\n", routeError, error);
        }

}];&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 15:43:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-API-v2-possible-to-overwrite-files-at-upload/m-p/199550#M9290</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-12-27T15:43:02Z</dc:date>
    </item>
  </channel>
</rss>

