We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Chez B.
11 years agoNew member | Level 1
How do I upload a file to my dropbox apps folder in dropbox in objective c?
Currently nothing happens when I run my code.
This is how I am setting the up client. I did not put the client set up in my viewDidLoad method because this class will never be shown it just hand...
Chez B.
11 years agoNew member | Level 1
In my app delegate method I checked to see if the session was linked and from my test the logs states that my session is linked.
if ([[DBSession sharedSession] isLinked]) {
NSLog(@"The session IS linked");
} else {
NSLog(@"The session is not linked");
}
I have checked my app console and is says that one users is connected to the app and it also says that I made one API call yesterday. However I don't see the test image that I wast trying to upload to dropbox. I am wondering if I am uploading the file incorrectly. This is my upload method
- (void)uploadToDropBox:(UIImage *)img
{
UIImage *testPic = [UIImage imageNamed:@"IMG_0005.jpg"];
NSArray *directories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES);
NSString *documentDirectory = [directories firstObject];
NSString *imagePath = [documentDirectory stringByAppendingPathComponent:@"cardImage"];
NSString *destDir = @"/";
NSData *imageData = UIImagePNGRepresentation(testPic);
[imageData writeToFile:imagePath atomically: YES];
[self.restClient uploadFile:@"cardImage" toPath:destDir withParentRev:nil fromPath:imagePath];
[self sendBDayCard];
}
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!