Wednesday, October 29, 2014

Get httpPostedFileBase FileName only code or extract last portion of file director path

var httpPostedFileBase = Request.Files.Get("DocumentFileName");
               var myFileName = string.Empty;
               if (httpPostedFileBase != null)
               {
                   int position = httpPostedFileBase.FileName.LastIndexOf('\\');
                   myFileName = httpPostedFileBase.FileName.Substring(position + 1);
               }

No comments:

Python Logging Best Practices

Python Logging Best Practices Introduction to Python Logging Importance of Logging in Business Applications Logging is an essential ...