You can easily extract the file name from the path by using a single method. System.IO.Path.GetFileName(File1.PostedFile.FileName);