Extract file name

Topics: Troubleshooting
Apr 8, 2012 at 6:01 PM

How to extract of the url recorded in the mediapicker the file name?

Example: I have "@Model.ContentField.Url", but I want to extract only the file name

Developer
Apr 8, 2012 at 9:16 PM

You could use the GetFileName method of the VirtualPathUtility class: http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility_methods.aspx