2013-07-08 7 views
6

alle. Und immer du sehr.Fehler mit Fehler 1001 "Dropbox SDK v1.3.4" und "IOS 6.0"

schlägt mit Fehler 1001 "Dropbox SDK v1.3.4" und "IOS 6.0"

"Upload.mov" eine Datei mit 5 MB ist.

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} 

Upload-Prozess bestätigt wird, dass Sie in die Mitte Fortschritte gemacht haben. Problem tritt nicht mit iOS5.1.1 auf. Ich habe erfolgreich verarbeitet. In iOS6.0 ist dieses Problem aufgetreten. Was soll ich jetzt tun?

Es scheint ein Problem zu sein, das vom Terminal des iPhone5 abhängt.

Das Menü Beenden, um sicherzustellen, dass die ausgewählten Werte erfolgreich übertragen wurden.

Beenden Sie durch Generieren eines 1001 Fehler während der Dateiübertragung von 5 MB.

iPhone5 iOS 6.1.4 ---> Error 

Dropbox SDK ist, oder würde nicht dem Terminal des iPhone5 entsprechen?

+0

'NSURLErrorTimedOut' zurückgegeben, wenn ein asynchroner Vorgang abläuft. 'NSURLConnection' wird diesen Fehler an seinen Delegaten senden, wenn das timeoutInterval in' NSURLRequest' abläuft, bevor ein Ladevorgang abgeschlossen werden kann. – Bala

Antwort

4

Fehler -1001 auf NSURLDomain ist NSURLErrorTimedOut.

Das Standard-Zeitlimit für Dropbox SDK ist 20s.

+0

Vielen Dank! Wie ändere ich von einem Programm die Einstellung des Time-Out Dropbox SDK? Gibt es Methoden, Eigenschaften wie diese? Allerdings, in dieser Ausgabe, die nur iPhone5 besorgt sind. –

+1

In Zeile 1300 von 'DBRestClient.m' gibt es ein' [urlRequest setTimeoutInterval: 20]; '. Du könntest das ändern. –

+0

Vielen Dank! Der Ausweg, ich möchte, dass es nur diesen Weg gibt. –

2

Anstatt es mit Timeout zu spielen, ist es besser, die Datei, die nicht hochgeladen werden kann, umzuleiten, indem wir den uploadFileFailedWithError-Delegaten der Dropbox api verwenden.

Ich habe Folgendes getan, um mehrere Dateien auf Drop-Box hochzuladen.

(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]; 

} 

Auf diese Weise werden die Dateien, die werden konnte nicht laden lassen erneut versuchen, hochgeladen werden ..

+0

Thanka viel ... Sie sind die besten :) – Karun

+0

Dies würde eine unendliche Schleife von rekursiven Uploading Requests im Falle von wiederholten fehlgeschlagenen Anfragen initiieren. –

0

Ich weiß, diese Frage als gelöst markiert ist, aber ich fand etwas auf DropboxCommunity, die für zukünftige Leser hilfreich sein können.

Dieser Fehler kann auftreten, wenn Sie versuchen, große Dateien (größer als 150 MB) hochzuladen. Wenn dies der Fall ist, verwenden Sie besser uploadFileChunk statt uploadFile.

Also hier ist es ein kleiner Ausschnitt für weitere Hilfe:

// First call to the method upload_id must be nil, to tell it is a new upload 
// offset is 0 (file is being upload from the beginning)  
[self.restClient uploadFileChunk:nil offset:0 fromPath:localFilePath]; 

// Every time a chunk is uploaded the DBRestClient delegate method will be called 
- (void) restClient:(DBRestClient *)restClient 
    uploadedFileChunk:(NSString *)uploadId 
      newOffset:(unsigned long long)offset 
      fromFile:(NSString *)localPath 
      expires:(NSDate *)expiresDate { 
    NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:localPath error:NULL]; 
    unsigned long long fileSize = [attributes fileSize]; // in bytes 

// Meanwhile the new offset is smaller than the file size we keep uploading chunks 
    if (offset < fileSize) { 
     [self.restClient uploadFileChunk:uploadId offset:offset fromPath:localPath]; 
    } 
// When all the chunks are in Dropbox, convert all the uploaded data to the file 
    else { 
     [self.restClient uploadFile:self.fileName 
          toPath:remoteParentFolder 
         withParentRev:self.parentRev 
         fromUploadId:uploadId]; 
    } 
}