+1-888-365-2779
Try Now
More in this section

Forums / Module Builder / Getting Image Field

Getting Image Field

3 posts, 0 answered
  1. Dhanya
    Dhanya avatar
    1 posts
    Registered:
    01 Aug 2013
    01 Aug 2013
    Link to this post
    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
    Dhanya

  2. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    Registered:
    04 Jan 2016
    06 Aug 2013
    Link to this post
    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.

    Regards,
    Atanas Valchev
    Telerik
    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
  3. John
    John avatar
    14 posts
    Registered:
    23 Aug 2012
    27 Aug 2013 in reply to Dhanya
    Link to this post
    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. 
    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.
3 posts, 0 answered