Getting Image Field

Posted by Community Admin on 05-Aug-2018 08:50

Getting Image Field

All Replies

Posted by Community Admin on 01-Aug-2013 00:00

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

Posted by Community Admin on 06-Aug-2013 00:00

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

Posted by Community Admin on 27-Aug-2013 00:00

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.

This thread is closed