Hi, can't you use the public URL to the thumbnail? Not sure what format this is "http://localhost:8000/episerver/f791355aa6334c92b5f370c5cfafd971/adc882777a04431baae83a2e05f3f02d.jpg", it looks like nothing our APIs would produce. You can access thumbnail properties by appending the property name to the URL:
private readonly IUrlResolver _urlResolver; var thumbnailUrl = _urlResolver.GetUrl(imageContentReference) + "/thumbnail";
This works for any thumbnail property your content type might have. 'Thumbnail' is the default thumbnail property available on ImageData.
If you have a content reference to the media, then it's easier to follow Johans suggestion.
However, if you only have access to the blob instance - have you tried using the blob.ID property? Can be used in one of the following ways:
Blob blob = ...; var url = UrlResolver.Current.GetUrl(new UrlBuilder(blob.ID), ContextMode.Default); // ... or in a Razor file ... @Url.ContentUrl(new Url(blob.ID)) // ... and also explore ... var absolutePath = blob.ID.AbsolutePath;
I'm creating a blob file using the following method in my code
Adding to Blob
I Need to get a relative path to this Thumbnail object so that I can use it to render the image in site. I can use Thumbnail.ID.AbsoluteUri to get this :
instead of that, I need something like this:
Can anyone guide me to have something that I can use as normal Url for images?