Get all folders of URL

拜拜、爱过 提交于 2019-11-27 05:32:33

You can not make use of NSFileManager to access the remote folders. This class is able to access the local directories only.
If your server supports FTP connection then you can make use of CFFTPStream.
CFFTPStream Reference

You can't do this with NSFileManager. NSFileManager is intended to work with your file system (your device's file system) not with server.

you need to create a server side file which should give you folder/files url in xml file

So if I understand correctly, you have the list of all the folders in the folder you need to read, but now you need specific files from each folder?

Then why don't you create a for-loop?

for (int i = 0; i < [contentlist count]; i++
{
    //do your trick to get the file in the folder
    //save it
}

EDIT: If you mean you get the files from your Mac instead of the server you need, then you should change the line contentsOfDirectoryAtURL:directory to something like contentsOfDirectoryAtURL:@"http://localhost/myserver/.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!