Benny Sutton is 4 hire - just click here

Helper for System.IO.Path.GetFileName

helper for System.IO.Path.GetFileName e.g. "/images/ben.jpg" returns "ben.jpg"

           
        public static string GetFileName(this string filepath)
        {
            return System.IO.Path.GetFileName(filepath);
        }
        
    

Extension methods are easy to chain, simply call like this...

         
           Source = httpPostedFile.FileName.GetFileName();