簡體   English   中英

如何使用同步API將現有文件從ios應用添加到保管箱服務器?

[英]How to add existing files from ios app to dropbox server using sync api?

Dropbox和其他教程中的所有文檔都在討論創建新文件並使用sync api與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同步api將現有文件上傳到我的應用程序中的Dropbox?

我認為您想要writeContentsOfFile

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM