1

I'm working with c# project and Tridion 2011 and I have a component item that is an image and I need to get the name of the upload image to this component. So I have this:

protected static Component GetComponentValue(string fieldName, ItemFields fields)
    {
        if (!fields.Contains(fieldName))
            return null;

        ComponentLinkField field = fields[fieldName] as ComponentLinkField;
        return field.Value;
    }
Component images = GetComponentValue(dataFieldName, fields);
5

If you're asking about the filename, then to get the original uploaded filename from a multimedia component you need to access it's BinaryConent.Filename property.

If you just mean the component's title, then it's just .Title

| improve this answer | |
  • I mean the first one and what you gave me works perfect. Thanks!! – Ignacio Tome Mar 15 '16 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.