var httpPostedFileBase = Request.Files.Get("DocumentFileName"); var myFileName = string.Empty; if (httpPostedFileBase != null) { int position = httpPostedFileBase.FileName.LastIndexOf('\\'); myFileName = httpPostedFileBase.FileName.Substring(position + 1); }
This blog shares my journey as a software engineer, along with personal reviews and life experiences I’ve gained along the way. “I have not failed. I've just found 10,000 ways that won't work.” — Thomas Edison. If you enjoy my content, please support it by clicking on ads (free for you, big help for me!) or by buying me a coffee on Ko-fi. Thank you!
Wednesday, October 29, 2014
Get httpPostedFileBase FileName only code or extract last portion of file director path
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment