Get all folders of URL

前端 未结 3 491
鱼传尺愫
鱼传尺愫 2020-11-30 14:56

Hi I\'m trying to read all files from a given server. What I want to do:

  • Read all the folders
  • Get the file URLs inside the folders

I tr

3条回答
  •  被撕碎了的回忆
    2020-11-30 15:21

    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/.

提交回复
热议问题