Getting Image Field - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Getting Image Field

  • Getting Image Field
  • Hi,
    I am very new to sitefinity. I am struggling a bit with the module builder. I have created a module using module builder. I have few fields and one is with image datatype. I could create the data for the module and successfully upload the image too. My issue is while i trying to fetch the data from DB i could not get the image that i have uploaded. I have checked the DB and found that the data is successfully stored including image.(But the data is duplicated) But i failed to get the image path or related data from DB. I searched for help and could not get a solution.
    If anyone can direct me to get the solution it would be a great help. I am using the sitefinity version  6.1

    Thanks in Advance

  • Hi Dhanya,

    Thank you for contacting us.

    Would it be possible to share more details regarding the scenario you want to achieve, please? How are you trying to access the image and where do you want to display/use it? 

    Thank you in advance.

    Atanas Valchev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Image is stored as content link in database. I also created a module using module builder in which has a field Picture which is stored image. I use the following to get the image url and it is working. You can try. 
                    var link = (ContentLink[]) profileItem.GetValue("Picture");
                    if (link != null && link.Length > 0)
                        var image = LibrariesManager.GetManager().GetImage(link[0].ChildItemId);
                        ImageUrl = image.Url;

    profileItem is DynamicContent type.