Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在dropbox上上载图像时出错_Iphone_Ios_Dropbox - Fatal编程技术网

Iphone 在dropbox上上载图像时出错

Iphone 在dropbox上上载图像时出错,iphone,ios,dropbox,Iphone,Ios,Dropbox,我正在开发一个IPhone应用程序,我需要将图像上载到文件夹中。我正在从保存的相册中拍摄图像并将其保存到文件夹中。我想上载该图像,但出现错误 这是我的密码 NSMutableArray *array=[[NSMutableArray alloc]init]; NSString *folderName; if (metadata.isDirectory) { NSLog(@"Folder '%@' contains:", metadata.path); for (DBMetadat

我正在开发一个IPhone应用程序,我需要将图像上载到文件夹中。我正在从保存的相册中拍摄图像并将其保存到文件夹中。我想上载该图像,但出现错误

这是我的密码

NSMutableArray *array=[[NSMutableArray alloc]init];
NSString *folderName;
if (metadata.isDirectory) {
    NSLog(@"Folder '%@' contains:", metadata.path);
    for (DBMetadata *file in metadata.contents)
    {
        [array addObject:file.filename];
        NSLog(@"\t%@", file.filename);
    }

    folderName=[array objectAtIndex:0];
}

NSString  *pngImagePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png",imageName.text]];
[data writeToFile:pngImagePath atomically:YES];

[[self restClient]uploadFile:[NSString stringWithFormat:@"%@.png",imageName.text] toPath:[NSString stringWithFormat:@"/%@",folderName]withParentRev:nil fromPath:pngImagePath];
我在犯错误

File upload failed with error - Error Domain=NSURLErrorDomain
Code=-1021 "The operation couldn’t be completed. (NSURLErrorDomain
error -1021.)" UserInfo=0x68d0c70 {destinationPath=/sonal/abc.png,
sourcePath=/Users/bcod/Library/Application Support/iPhone
Simulator/5.0/Applications/44555D9C-422E-45FC-B392-F74275B16378/Documents/abc.png}
我也收到了以下警告

[WARNING] DropboxSDK: error making request to
/1/files_put/dropbox/apple/app.png
请任何人都告诉我为什么我会犯这个错误


提前感谢

检查目的地路径。。问题似乎是服务器无法找到目标文件夹


还要检查图像大小。大文件可能导致它耗尽请求。尝试使用较小的图像

您是在dropbox中使用沙盒还是出现生产问题?我正在使用完整的dropbox我尝试检查两者,但仍然得到相同的错误路径需要是当前元数据路径,该路径是您在委托的loadedMetadata中获得的,而不是您尝试过的简单路径,但仍然面临相同的问题同样的问题。你解决这个问题了吗?所以请分享它。