After googling, I found exact information from this article:
Get Thumbnail File:
string urlthumbnail = oitem["EncodedAbsThumbnailUrl"].ToString();
Above will return thumbnail view url
SPFile filethumbnail = olist.RootFolder.SubFolders["_t"].Files[urlthumbnail];
Above will return file object and you can get absolute url
you can get absolute url of file
string absUrl = Convert.ToString(oItem[SPBuiltInFieldId.EncodedAbsUrl]);
Get Preview File:
string urlpreview = urlthumbnail.Replace("_t", "_w");
SPFile filepreview = olist.RootFolder.SubFolders["_w"].Files[urlpreview];
Just a note: you can also use oitem["EncodedAbsWebImgUrl"].ToString() to get the url of the preview image directly.
ReplyDeletethanks for your comment
ReplyDelete