失败,出现错误1001“Dropbox SDK v1.3.4”和“IOS 6.0”

时间:2013-07-08 22:20:06

标签: ios objective-c ios6 sdk dropbox

大家。永远都是你。

失败,错误1001“Dropbox SDK v1.3.4”和“IOS 6.0”

“Upload.mov”是一个5MB的文件。

NSString* filename = @"upload.mov";
NSString* destDir = @"test";
NSString* srcPath = @"test";
[restClient uploadFile:filename toPath:destDir withParentRev:nil fromPath:srcPath];

Consolelog

2013-07-09 06:53:13.110 DropBoxTest [13243:907] - (void) Start_Dropbox
2013-07-09 06:53:13.216 DropBoxTest [13243:907] if (! RestClient) {[DBRestClient alloc] initWithSession:
2013-07-09 06:53:17.365 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.006782
2013-07-09 06:53:17.370 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.013564
2013-07-09 06:53:17.373 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.020345
2013-07-09 06:53:17.374 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.027127
2013-07-09 06:53:51.652 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.033909
2013-07-09 06:53:51.656 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.040691
2013-07-09 06:53:51.657 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.047472
2013-07-09 06:53:51.660 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.054254
2013-07-09 06:53:51.662 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.061036
2013-07-09 06:53:51.665 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.067818
2013-07-09 06:53:51.668 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.074600
2013-07-09 06:53:51.671 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.081381
2013-07-09 06:53:51.674 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.088163
2013-07-09 06:53:51.677 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.094945
2013-07-09 06:53:51.679 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.101727
2013-07-09 06:53:51.682 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.108508
2013-07-09 06:54:40.271 DropBoxTest [13243:907] File upload restClient: uploadProgress - 0.115290
2013-07-09 06:55:40.320 DropBoxTest [13243:907] [WARNING] DropboxSDK: error making request to / 1/files_put/dropboxtestupload.mov - (-1001) Error Domain = NSURLErrorDomain Code = -1001 "The operation couldn 't be completed. (NSURLErrorDomain error -1001.) "UserInfo = 0x2087fb70 {destinationPath = test / upload.mov, sourcePath = upload.mov}

上传过程已确认您已进入中间位置。 iOS5.1.1不会出现问题。我成功处理了。 在iOS6.0中,出现了此问题。 我现在该怎么办?

这似乎是一个依赖于iPhone5终端的问题。

退出菜单,确保您选择的值成功传输。

iPhone4 iOS 6.1.3  ---->successfully.
iPhone4S iOS 5.1.1  ---->successfully.
iPad3 iOS 5.1.1  ---->successfully.

在文件传输5MB期间生成1001错误退出。

iPhone5 iOS 6.1.4  ---> Error

Dropbox SDK是或者不对应iPhone5的终端?

2 个答案:

答案 0 :(得分:4)

NSURLDomain上的错误-1001为NSURLErrorTimedOut

Dropbox SDK上设置的默认超时为20秒。

答案 1 :(得分:2)

使用Dropbox api的uploadFileFailedWithError委托,我们可以更好地重定向无法上传的文件,而不是使用超时来玩它。

我做了以下操作,以便在投递箱上上传多个文件。

(void)restClient:(DBRestClient*)client uploadFileFailedWithError:(NSError*)error {


    NSLog(@"File upload failed with error - %@", error.userInfo);

    NSString *myfile=[error.userInfo valueForKey:@"sourcePath"];

    [self.restClient uploadFile:@"youfilename" toPath:@"/yourfilepath" withParentRev:nil fromPath:myfile];

}

这样,无法上传的文件将重新尝试上传..