update media problems - can't access additional properties
hi
i should start out by saying that i am not familiar with .net to any degree, and so forgive me if my question is a bit on the simple/obvious side.
i have added a couple of properties to my default media 'file' type. a title and a description BUT I CAN'T ACCESS THEM.
i want to be able to execute a blanket update to add the name of the file to the title after cleaning it up a bit.
i have the following code so far:
**
protected void GetMedia(Media[] meds)
{
foreach (Media m in meds)
{
String mType = "";
//THIS WILL CHECK WHETHER THE ITEM IS A FOLDER OR A FILE
if (!m.HasChildren)
//NOW WE NEED TO FILTER THE MEDIA TYPES
mType = m.getProperty("umbracoExtension").Value.ToString();
//CHECK IF THE ITEM IS A PDF
if (mType == "pdf")
//SET THE DOCUMENT TITLE TO EQUAL THE NAME
Response.Write("<hr>::" + "<br />::" + m.Id + "::<br />::" + m.Text + "::<br />::" + mType + "::<br />::" + m.sortOrder);
if (m.HasChildren)
GetMedia(m.Children);
}
}
**
so far so good, i get a list of all pdf items in the media section, with some of their proerties/attributes.
BUT i have added a property 'fileTitle' to the 'file' media type, and i have tried accessing this with:
Type = m.getProperty("umbracoExtension").Value.ToString();
update media problems - can't access additional properties
hi
i should start out by saying that i am not familiar with .net to any degree, and so forgive me if my question is a bit on the simple/obvious side.
i have added a couple of properties to my default media 'file' type. a title and a description BUT I CAN'T ACCESS THEM.
i want to be able to execute a blanket update to add the name of the file to the title after cleaning it up a bit.
i have the following code so far:
**
**
so far so good, i get a list of all pdf items in the media section, with some of their proerties/attributes.
BUT i have added a property 'fileTitle' to the 'file' media type, and i have tried accessing this with:
but this is throwing an error.
Can anybody help me out, i need to know:
you should be able to access the properties using:
Hope that helps... RDNZL
thanks RDNZL.
i don't know what i was doing wrong, but it all seems to work now.
is working on a reply...