Image.Id or Image.FileId
can anyone tell me the difference between and image.id and image.FileId?
I'm getting all the images from an album and building a UL with links around the images to a different page trying to pass the imageid but they all seem to be the same. FileId seems to be unique but I can't find what the difference is.
this is my code.
var imagelist = (from t in GetImagesByAlbumNativeAPI(album.Id)
orderby t.DateCreated descending
select t).Take(3);
htm = "<ul class=WorkAllUl>";
string currenturl = "/work/" + LOBName.Replace(" ", "-");
if (imagelist.Count() > 0)
foreach (var m in imagelist)
htm += "<li class=WorkAllLi>";
htm += "<a href=" + currenturl + "?id=" + m.Id + "&id2=" + m.FileId + ">";
htm += "<img src='" + m.Url + "' alt='" + m.AlternativeText + "' data-image-id='" + m.Id + "' data-image-Fileid='" + m.FileId + "' class=WorkAllImage></a>";
htm += "</li>";
Hi Theodore,
The ID you need is Image.Id. It relates to the image and represents it in the database. The FileId property is also related to the image, but is only used to generate thumbnails for the image. As far as the issue goes, I can only imagine there is something wrong with your initial query. All Image Ids are unique and represent an image. I can suggest the following lines that will return the ID of 3 published images:
LibrariesManager librariesManager = LibrariesManager.GetManager();
var AlbumId = librariesManager.GetAlbums().Where(a => a.Title ==
"YourAlbum"
).FirstOrDefault();
var imagelist = AlbumId.Images().Where(i => i.Status == ContentLifecycleStatus.Live).Take(3);