SaaS CMS has officially launched! Learn more now.

How to get blob URL



I have a product that has a image resource. I need to get the blob URL to that image.

How do I get that?

I get the image from productContent.CommerceMediaCollection.First()

I have try IBlobFactory, but then I need to URI.

Any idea?


Nov 04, 2019 15:50
Edited, Nov 04, 2019 17:18

var asset = currentContent.CommerceMediaCollection[0];
var assetContent = contentLoader.Get<IContentMedia>(asset.AssetLink);
var blob = assetContent.BinaryData;

this would give you the blob to the asset, without even getting the uri (if you want that then blob.ID)

Edited, Nov 10, 2019 19:08
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.