Get all (unified) files


Is it possible to retrive all files in an directory and it's subdirectories? Let's say we have the following structue:

    folder A
        File A-A
        File A-B
        folder B
            File B-A

Can i retrive all these files (File A-A, File A-B, File B-A ect) if I only have the root-path?


Feb 08, 2010 16:34

If I'm not mistaken there is a filesystemdatasource control that you can use. I think you can specify the depth you're intrested in.

Check the sdk.

Feb 10, 2010 14:19

Or make your own function

void GetAllFiles(UnifiedDirectory start, List<UnifiedFile> files)

    foreach (UnifiedFile file in start.GetFiles())
    foreach (UnifiedDirectory dir in start.GetDirectories())
        GetAllFiles(dir, files);

Feb 10, 2010 15:50
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.