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.
How could I do that?
I have an array called sortedFiles. Then I have
int i = 0;
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];
NSLog(@"File already exists");
NSLog(@"The number is %d", i);
while (i < sortedFiles.count);
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.
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?