[英]Knowing when a file has uploaded to Dropbox
I have managed to get my app to upload to Dropbox like so:我设法让我的应用程序像这样上传到 Dropbox:
NSString *docsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
[self.restClient uploadFile:@"ZipTest.zip" toPath:[NSString stringWithFormat:@"/%@", self.dropboxFolderName] fromPath:docsPath];
But am now trying to verify it actually completed the upload.但我现在正试图验证它是否真的完成了上传。 I know I can check for errors but how to check for completion?我知道我可以检查错误但如何检查是否完成?
I have tried using:`- (void)restClient:(DBRestClient*)client uploadProgress:(CGFloat)progress forFile:(NSString *)destPath from:(NSString *)srcPath {我试过使用:`- (void)restClient:(DBrestClient*)client uploadProgress:(CGFloat)progress forFile:(NSString *)destPath from:(NSString *)srcPath {
Buut all I get is the number 1 printed even though I see on Dropbox the file has not completed the upload yet?但是,即使我在 Dropbox 上看到文件尚未完成上传,我得到的只是打印的数字 1?
any ideas?有任何想法吗?
Thanks`谢谢`
- (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];
}
I used this code to check file is uploaded or not and after uploading this alert will show我使用此代码检查文件是否已上传,上传后此警报将显示
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.