<?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: How can I check to see if a file already exists with Dropbox Sync iOS API? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-check-to-see-if-a-file-already-exists-with-Dropbox/m-p/122695#M3578</link>
    <description>&lt;P&gt;You can use &lt;CODE&gt;DBFilesystem.fileInfoForPath&lt;/CODE&gt;:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/sync/docs/ios#DBFilesystem.fileInfoForPath:error:" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers/sync/docs/ios#DBFilesystem.fileInfoForPath:error:&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You probably want to do that before you do &lt;CODE&gt;createFile&lt;/CODE&gt; though.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Feb 2015 01:15:05 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2015-02-17T01:15:05Z</dc:date>
    <item>
      <title>How can I check to see if a file already exists with Dropbox Sync iOS API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-check-to-see-if-a-file-already-exists-with-Dropbox/m-p/122694#M3577</link>
      <description>&lt;P&gt;I would like my app to test whether there is already a file at certain path before trying to upload a file to that path.&lt;/P&gt;

&lt;P&gt;How could I do that?&lt;/P&gt;

&lt;P&gt;I have an array called sortedFiles. Then I have&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;int i = 0;

    do{

        NSString *fileName = [NSString stringWithFormat:@"Pace audio/%@", [[sortedFiles objectAtIndex:i] objectForKey: @"path"]];
        DBPath *newPath = [[DBPath root]childPath:fileName];
        DBFile *file = [[DBFilesystem sharedFilesystem] createFile:newPath error:nil];

        if ( ) //and some sort of test here to see if the file already exists at this path
            [file writeContentsOfFile:fileName shouldSteal:NO error:nil];
        else {
            NSLog(@"File already exists");
        }

        NSLog(@"The number is %d", i);
        i++;

    }
    while (i &amp;lt; sortedFiles.count);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've been searching the documentation and I can't think of a way to do this. At the moment, I just get an error saying a file already exists, so at least the file isn't being overwritten.&lt;/P&gt;

&lt;P&gt;Ideas?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:45:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-check-to-see-if-a-file-already-exists-with-Dropbox/m-p/122694#M3577</guid>
      <dc:creator>Matthew W.8</dc:creator>
      <dc:date>2019-05-29T09:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check to see if a file already exists with Dropbox Sync iOS API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-check-to-see-if-a-file-already-exists-with-Dropbox/m-p/122695#M3578</link>
      <description>&lt;P&gt;You can use &lt;CODE&gt;DBFilesystem.fileInfoForPath&lt;/CODE&gt;:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/sync/docs/ios#DBFilesystem.fileInfoForPath:error:" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers/sync/docs/ios#DBFilesystem.fileInfoForPath:error:&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You probably want to do that before you do &lt;CODE&gt;createFile&lt;/CODE&gt; though.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 01:15:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-check-to-see-if-a-file-already-exists-with-Dropbox/m-p/122695#M3578</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-02-17T01:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check to see if a file already exists with Dropbox Sync iOS API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-check-to-see-if-a-file-already-exists-with-Dropbox/m-p/122696#M3579</link>
      <description>&lt;P&gt;Thanks and good catch. That worked&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 11:06:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-check-to-see-if-a-file-already-exists-with-Dropbox/m-p/122696#M3579</guid>
      <dc:creator>Matthew W.8</dc:creator>
      <dc:date>2015-02-17T11:06:36Z</dc:date>
    </item>
  </channel>
</rss>

