Looping through files uploaded to Global files

Vote:
 

I'm at a loss as how to start into this one as I've not found any clues in the SDK's framework reference.

I have a number of images uploaded to Global Files/somefolder and want to loop through the 'somefolder' to create paths to the image and grab the Description property from the image's summary if a publisher has provided it.  This information will be collated in to a config string for a javascripted image gallery presenter on various pages.

That's what I want to do:  Any pointers on how I read through the Global Files area, its subfolders, and the images would be appreciated.

TIA

#45517
Nov 10, 2010 5:07
Vote:
 

// Get the directory
UnifiedDirectory directory = (HostingEnvironment.VirtualPathProvider.GetDirectory("~/periodicals/") as UnifiedDirectory)
            
// Get the files in that directory
UnifiedFile[] files = directory.GetFiles()

// Get values from the FileSummary on an individual file
string author = files[0].Summary.Dictionary["Author"].ToString();
    

Hope this helps.

#45518
Edited, Nov 10, 2010 7:04
Vote:
 

Very grateful.  That's the lead-in I needed.  Thanks.  Now to just get the javascript working!

#45618
Nov 10, 2010 22:27
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.