知道文件何时上传到Dropbox

时间:2011-06-03 09:50:56

标签: iphone file-upload upload dropbox

我设法将我的应用程序上传到Dropbox,如下所示:

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

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

但我现在正在尝试验证它确实完成了上传。我知道我可以检查错误但是如何检查完成?

我试过使用:` - (void)restClient:(DBRestClient *)client uploadProgress:(CGFloat)progressFile:(NSString *)destPath from:(NSString *)srcPath {

即使我在Dropbox上看到文件还没有完成上传,我得到的就是打印的数字1?

任何想法?

Thanks`

1 个答案:

答案 0 :(得分: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];





}

我使用此代码检查文件是否已上传,上传此警报后将显示