2013-07-08 9 views
6

wszyscy. I zawsze bardzo.Błąd z błędem 1001 "Dropbox SDK v1.3.4" i "IOS 6.0"

nie powiedzie się z powodu błędu 1001 "Dropbox SDK v1.3.4" i "IOS 6.0"

"Upload.mov" jest plikiem z 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} 

Proces przesyłania potwierdza, że ​​postępują w środku. Problem nie występuje w iOS5.1.1. Z powodzeniem przetworzyłem. W iOS6.0 problem ten wystąpił. Co mam teraz zrobić?

Wydaje się, że jest to problem zależny od terminala iPhone'a5.

Menu Wyjdź, aby upewnić się, że wybrane wartości zostały pomyślnie przesłane.

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

Wyjście generując błąd 1001 podczas transferu plików 5MB.

iPhone5 iOS 6.1.4 ---> Error 

Zestaw SDK Dropbox jest lub nie odpowiada terminalowi iPhone5?

+0

'NSURLErrorTimedOut' zwracany, gdy an asynchroniczne czasy pracy na zewnątrz. 'NSURLConnection' wyśle ​​ten błąd do swojego delegata, gdy upłynie limit timeoutInterval w' NSURLRequest' zanim skończy się ładowanie. – Bala

Odpowiedz

4

Błąd -1001 na NSURLDomain jest NSURLErrorTimedOut.

Domyślny limit czasu ustawiony dla zestawu SDK Dropbox to 20s.

+0

Dziękuję! Jak zmienić program, ustawienie limitu czasowego zestawu SDK Dropbox? Czy istnieją metody, właściwości takie jak to? Jednak w tym numerze martwi Cię tylko iPhone5. –

+1

W linii 1300 'DBRestClient.m', istnieje' [urlRequest setTimeoutInterval: 20]; '. Możesz to zmienić. –

+0

Dziękujemy! Wyjście, chciałbym, żeby było tylko w ten sposób. –

2

Zamiast odtwarzać je z limitem czasu, lepiej jest przekierować plik, który nie może przesłać, korzystając z funkcji uploadFileFailedWithError w interfejsie Dropbox.

Wykonałem następujące czynności, aby przesłać wiele plików w polu upuszczania.

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

} 

ten sposób pliki, których nie można przesłać dostanie ponowić próbę, aby załadowane ..

+0

Thanka wiele ...... Jesteś najlepszy :) – Karun

+0

To zainicjowałoby nieskończoną pętlę rekurencyjnych żądań przesyłania w przypadku wielokrotnych nieudanych próśb. –

0

Wiem, że to pytanie jest oznaczony jako rozwiązany, ale znalazłem coś na DropboxCommunity, które mogą być pomocne dla przyszłych czytelników.

Ten błąd może powstać podczas próby przesłania dużych plików (większych niż 150 MB). Jeśli tak jest, lepiej użyj uploadFileChunk zamiast uploadFile.

Więc tutaj jest trochę urywek aby uzyskać pomoc:

// 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]; 
    } 
} 
Powiązane problemy