【问题标题】:How to add existing files from ios app to dropbox server using sync api?如何使用同步 api 将现有文件从 ios 应用程序添加到 Dropbox 服务器?
【发布时间】:2014-03-07 10:45:36
【问题描述】:

Dropbox 和其他教程中的所有文档都在讨论创建新文件并使用同步 api 与 Dropbox 同步。

我的应用文档目录中有一些文件,我想将它们与 Dropbox 服务器同步。

这就是我所做的。

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"emmy.txt"];

    DBPath *newPath = [[DBPath root] childPath:path];
    DBFile *file = [[DBFilesystem sharedFilesystem] createFile:newPath error:nil];
    //[file writeString:str error:nil];

    DBFileStatus *status = file.status;
    if (!status.cached) {
        [file addObserver:self block:^() {
        }];

    }

在 Dropbox 上创建的文件,但它是空的。我的应用程序中的文件有内容。

如何使用 Dropbox 同步 api 将现有文件上传到我的应用中的 Dropbox?

【问题讨论】:

    标签: ios iphone ipad sync dropbox-api


    【解决方案1】:

    我想你想要writeContentsOfFile。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-29
      • 1970-01-01
      • 2023-03-28
      • 2014-09-23
      • 2016-05-26
      • 2013-11-09
      • 2023-03-23
      • 1970-01-01
      相关资源
      最近更新 更多