In my iOS App, I am trying to use the "uploadFile" call provided by Dropbox. I am using ALAssetsLibrary to choose a particular Photo/Video obtained programatically as an Asset. I need to upload that particular asset to dropbox.
//ALAsset *asset is the asset i intend to upload
[self.restClient uploadFile:[asset.defaultRepresentation filename] toPath:@"/" withParentRev:nil fromPath:[asset.defaultRepresentation.url absoluteString]];
Dropbox doesn't seem to like the path that the asset carries, which looks something like this : "assets-library://asset/asset.PNG?..."
I have enabled location services for the app and i am able to list all the assets as well.
The upload call throws the error, "[WARNING] DropboxSDK: File does not exist (assets-library://asset/asset.PNG?id=5DC234C1-B27E-45E2-BE61-46E9A266C818&ext=PNG)", in the logs.
The uploadFileFailedWithError function gets called with a error - ("Error Domain=dropbox.com Code=1001 "The operation couldn’t be completed. (dropbox.com error 1001.")
Is there anything wrong about the way i am sending the uploadFile call, especially the "from" path?? Any help will be greatly appreciated.