2011-06-03 92 views
1

我設法讓我的應用程序上傳到Dropbox的,像這樣:知道什麼時候一個文件上傳到Dropbox的

NSString *docsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; 

[self.restClient uploadFile:@"ZipTest.zip" toPath:[NSString stringWithFormat:@"/%@", self.dropboxFolderName] fromPath:docsPath]; 

但現在想驗證它實際完成上傳。我知道我可以檢查錯誤,但是如何檢查完成?

我已經嘗試使用:` - (無效)RESTClient實現:(DBRestClient *)客戶端上傳進度:從(的NSString *)destPath::(CGFloat的)進步forFile(的NSString *)srcPath {

Buut我得到的即使我在Dropbox上看到文件還沒有完成上傳,打印的數字是1嗎?

有什麼想法?

Thanks`

回答

1
- (void)restClient:(DBRestClient *)client uploadedFile:(NSString *)srcPath { 


    NSString *filename = [[srcPath pathComponents]lastObject]; 

    NSString *message = [NSString stringWithFormat:@"Uploaded File:%@",filename]; 

    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Success" 
                message:message delegate:nil cancelButtonTitle:@"Ok" 
             otherButtonTitles:nil]; 
    [alert show]; 
    [alert release]; 





} 

我用這個代碼來檢查文件上傳或不和上傳此警報後,將會顯示

+0

這是現在 - (空)RESTClient實現:(DBRestClient *)客戶端的UploadedFile :(NSString *)destPath來自:(NSString *)srcPath元數據:(DBMetadata *)元數據 – amergin 2015-09-10 10:31:52

相關問題