Download the file from Dropbox and save the path

I am trying to save a file from dropbox as follows:

NSString *fileName = [NSString stringWithFormat:@"/newFile.json"];
// Do any additional setup after loading the view, typically from a nib.

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 
                                                     NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString* path2 = [documentsDirectory stringByAppendingPathComponent: 
                  [NSString stringWithFormat:@"%@", fileName]];


[[self restClient] loadFile:fileName intoPath:path2];

the file is located in the apps / appname / sandbox / newFile.json folder

but I get this error:

2012-05-12 21: 05: 46.824 Fast homework and business [934: 707] [WARNING] DropboxSDK: error request in /1/files/sandbox/newFile.json - File not found

but there is a file!

+3
source share
1 answer

I found out that in order to access the al dropbox folders, even if in the sandbox folder your application must be set to "full access to Dropbox", otherwise this error appears. this problem, although there is only when trying to load from dropbox, and not when loading or loading metadata in a UITableView.

0
source

All Articles