How can I upload a photo to DropBox using iOS DropBox SDK. I have tried using the following code:
NSData *datobj = UIImagePNGRepresentation(uploadPhoto.image);
NSString *stringConvertion = [[NSString alloc] initWithData:datobj encoding:NSUTF8StringEncoding];
NSString *filename = stringConvertion;
NSString *destDir = @"/";
[[self restClient] uploadFile:filename toPath:destDir
withParentRev:nil fromPath:stringConvertion];
But i get the following response: [WARNING] DropboxSDK: File does not exist ((null))
You’re trying to make a string from the PNG data of the image. Note that
doesn’t return a file name — it returns an NSData object whose bytes represent raw PNG data.
Try this: