AI OnAI Off
Hi Lucster,
In 7.5 we switched from using VPP for media files and instead use the new media system (which now uses a blob provider to store files). Now files are content just like pages. You can get a content reference from a URL by using the UrlResolver.
http://world.episerver.com/documentation/Class-library/?documentId=cms/7/f590c418-4e1f-6d94-c1a0-d806a9ebd0e4
Hope this helps!
/T
Thanks Tony! that helped. So the approach is something like this:
Public bool FileExists(string path){ var urlResolver = ServiceLocator.Current.GetInstance<UrlResolver>(); UrlBuilder url = new EPiServer.UrlBuilder(path); var content = urlResolver.Route(url); MediaData mf = content as MediaData; if (mf != null && mf.BinaryData != null) { return true; } return false; }
Hi all,
Ugrade from CMS6r2 to 7.19.2 (webforms)
I want to check if image Exists on disc.
HostingEnvironment.VirtualPathProvider.FileExists("/globalassets/penguins.jpg") always false. (the image is there on the site)
EPiServer.Web.Hosting.VirtualPathHandler.GetProvider("SiteGlobalFiles") is null. (How do i know what the name is? since it is not in the episerverframework.config)
the images are working on the site.
Any Idea?