AI OnAI Off
vppFilePath.VirtualPath is the file location., the /link/58.... stuff is the guid path to the file, and will always work regardless if you move the file.
The pysical path to the file is vppFilePath.LocalPath
Sorry didn't make it clear in the example above, vppFilePath returns null when the argument is passed as:
CurrentPage.FileSrc //holds the value /BigAmbition/Images/Competition/Teacher%20Support%20Project%20Management_final.pdf
HostingEnvironment.VirtualPathProvider.GetFile("/BigAmbition/Images/Competition/Teacher%20Support%20Project%20Management_final.pdf") as UnifiedFile;
When I access CurrentPage.FileSrc this returns the friendlyUrl I want to know how to retrieve the vpp path.
scenario trying to allow the user to download and uploaded file from the VPP store:
using the page type builder I;ve declared the following property:
[PageTypeProperty(Searchable = false, Type = typeof(PropertyDocumentUrl), EditCaption = "File", HelpText = "File", Tab = typeof(InformationTab), SortOrder = 2)]
public virtual string FileSrc { get; set; }
now when I retrieve this value back it returns the relative path e.g.
var filePath = "/BigAmbition/Images/Competition/Teacher%20Support%20Project%20Management_final.pdf"
Trying to map this to the physical path using the following code:
var vppFilePath = HostingEnvironment.VirtualPathProvider.GetFile(filePath) as UnifiedFile;
when I look in table tblProperty the string field has the following value: ~/link/58ec8df05b0a4d52a6e6d86cde2c2141.pdf, when I hardcode this in the filePath the vpp path returns a unifiedfile back, question i have is how do I retrieve this value?