使用 SDK 将图像上传到文件夹我想获取图像的原始链接。我已经使用以下方法从 DMMetaData 中搜索了元数据。DBMetaData 拥有多种方法,例如“root”和“content”,但我总是收到 Null 响应。如果有人能引导我朝着正确的方向从响应中获取该信息,将不胜感激!
-(void)uploadImage:(UIImage *)image{
[sounds PlayUploading:nil];
NSLog(@"upload from uploader!~");
NSData *data = UIImagePNGRepresentation(image);
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *path = [[paths objectAtIndex:0] stringByAppendingString:@"PreviewMaker.png"];
[restClient setDelegate:self];
[data writeToFile:path atomically:YES];
[[self restClient] uploadFile:@"PreviewMaker.png" toPath:@"/"
withParentRev:nil fromPath:path];
}
-(void)restClient:(DBRestClient *)client uploadedFile:(NSString *)destPath
from:(NSString *)srcPath metadata:(DBMetadata *)metadata{
NSLog(@"uploaded: %@ from %@ withData %@",destPath,srcPath,metadata.root);
}