从Iphone App在Dropbox中创建一个文件夹 [英] Create a folder in dropbox from Iphone App

查看:179
本文介绍了从Iphone App在Dropbox中创建一个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS开发的初学者,刚刚开始使用适用于iOS的DropBox SDK。我正在使用具有模拟器4.2的XCode 3.2.5。我想以编程方式使用DropBox SDK在我的保管箱帐户上创建一个文件夹(或目录),并将文件直接上传到我的DropBox帐户中的该文件夹。我有以下代码上传文件

I am a beginner in iOS development and have just started using the DropBox SDK for iOS. I am using XCode 3.2.5 having the simulator 4.2 . I wanted to create a folder(or directory) on my dropbox account using the DropBox SDK programmatically and upload files directly to that folder in my DropBox account. I have the following code to upload a file

[[self restClient] uploadFile:@info.txttoPath:@/withParentRev :nil fromPath:sourceString];

我必须将此文件存储在名为TempData(假设)的文件夹中。然后,我尝试执行以下操作

I have to store this file inside a folder called TempData(suppose). Then, I tried doing the following

[[self restClient] uploadFile:@info.txttoPath:@/ TempData /withParentRev :nil fromPath:sourceString];

但是,它将文件上传到我的应用程序的默认目录中。此外,我可以将整个目录的内容上传到我的保管箱帐户。我有很多元数据文件需要与上传的文件一起上传。那么,有没有办法将文件夹的全部内容上传到dropbox。我在DropBox SDK 1.1版for iOS中查找了API,但它没有任何工具可以递归地上传目录或其所有内容。那么,我是否必须递归遍历目录的内容并发送多个请求?请帮助

but, it uploaded the file in the default directory for my App. Also, can I upload the contents of an entire directory in to my dropbox account. I have a lot of metadata files which need to be uploaded along with the uploaded files. So, is there a way to upload the entire contents of a folder to dropbox. I have looked up the API in DropBox SDK version 1.1 for iOS, but, it does not have any facility to upload an a directory or all of its contents recursively. So, Will I have to traverse recursively over the contents of a directory and send multiple requests? Please help

推荐答案

这用于在DropBox中创建文件夹

This is used to create a Folder in DropBox

[[self restClient] createFolder:@"/YourFolder"];

这用于获取新创建的文件夹的详细信息

This is Used to get details of the newly created folder

// Folder is the metadata for the newly created folder
- (void)restClient:(DBRestClient*)client createdFolder:(DBMetadata*)folder{
    NSLog(@"Created Folder Path %@",folder.path);
        NSLog(@"Created Folder name %@",folder.filename);
}
// [error userInfo] contains the root and path
- (void)restClient:(DBRestClient*)client createFolderFailedWithError:(NSError*)error{
    NSLog(@"%@",error);
}

这篇关于从Iphone App在Dropbox中创建一个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆