AI OnAI Off
Hi,
First you need to retrieve the MediaData item and then check if the blob is actually stored on disk (FileBlob). Something like this:
var media = UrlResolver.Current.Route(new UrlBuilder(Image)) as MediaData; if (media != null) { var fileBlob = media.BinaryData as FileBlob; if (fileBlob != null) { var path = fileBlob.FilePath; } }
You could also change your Image from Url to ContentReference, then you don't need to use the UrlResolver and makes it easier for the editor to select an image.
Thanks alot.. this did the trick... i also switched back to ContentReference for the Image property.
Hey Guys,
i have a property on my blocktype called Image of type URL. I'm using EPiServer CMS 8 btw and i'm a bit new to EPiServer.
Now when i select my image on the block, and in my view i dont want the friendly url to the image, but i want to have the raw url (with the {guid}/{guid}.png ) on disk.
How can i retrieve that?
Because my images are being cropped by a IIS web i use on another domain. So i need the url on disk for the blob (media).
Gives me something like /link/19130d49edd84c2483d6c44169fc1e5e.aspx but i want
\blobs\19130d49edd84c2483d6c44169fc1e5e\c58b93637cd84d7690e604a2aec03912.jpg