How to get blob URL

Vote:
 

Hi

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?

Thanks

#208893
Nov 04, 2019 15:50
Vote:
 
#208895
Edited, Nov 04, 2019 17:18
Vote:
 

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)

#209187
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.