November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Call PermanentLinkMapStore.Find and pass in your guid.
On the PermanentLinkMap you get back as result there is a property MappedUrl which is what you are looking for.
Hello Johan
Thanks for the response. However it didn't work. Remember I only have the local file name GUID. It's not the same as a GUID stored in the tblPageSoftlink.
The Find() method returns null in my case.
Any more ideas?
Ok, now I understand. The guid you have is actually the guid to a specific version of a file. In that case I think you would need to go towards Object Store (thats where metadata for files are stored) and load the related FileItem and then use that to resolve the url. Something like:
Guid versionId = new Guid("{your guid}");
ISession session = EPiServer.BaseLibrary.Context.Current.Repository.CreateSession();
try
{
var file = session.RelatedItemsTo<FileItem>(versionId).FirstOrDefault();
if (file != null)
{
string furl = PermanentLinkMapStore.Find((Guid)file.Id).MappedUrl.ToString();
}
}
finally
{
session.Close();
}
Hello again Johan,
superb, that was exactly what I was looking for. Thank you!
Regards,
Patrik
Hello
I have a file stored in the Global Files VPP. I know the local file name of this file (for example "d:\EPiServer\VPP\SimpleEPiServer6\Global\44\7f\447f7232-e9d8-49e9-bbd6-a5d67ab25a59.jpg"). The file is not referenced on the site. I need to convert the file name to a friendly URL. This is done by the built in File Manager when you browse the Global Files structure.
The local file name ("447f7232-e9d8-49e9-bbd6-a5d67ab25a59.jpg") is the local file name; it's not stored as a soft link, so I can't look it up by using EPiServer.Global.UrlRewriteProvider.ConvertToExternal().
So basically, I'm looking for how to convert 447f7232-e9d8-49e9-bbd6-a5d67ab25a59.jpg to /Global/MyImage.jpg (or whatever the friendly URL will look like).
If anyone knows how to solve this I'd be grateful.
Regards,
Patrik