slashes are missing while updating filepath using Server.MapPath in asp.net -


While updating the file path using ABPL slash, any one of the DB

Thanks in advance

  var filename = path. GetFileName (file.FileName); Var temp = path GetFileName (file.FileName); Var path = path Cobine (server.mappath ("~ / folder / images /"), filename); String extension = path GetExtension (fileName); String filenamename = path Gatefile extension extension without extension (filename); Var newFullPath = Path; Int Igmacount = 1; While (System.IO.File.Exists (newFullPath)) {string tempFileName = string.Format ("{0} ({1})", filename only, Imgnamecount ++); NewFullPath = Path.Combine (Server.MapPath (Url.Content ("~ / folder / images /"), tempFileName + extension); Temp = tempFileName;} File.SaveAs (newFullPath);   < / div> 

Try using / instead of / sometimes (back) slash is used as escape character

Comments

Popular posts from this blog

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

java - Ajax call to jsp and jsp redirecting to further jsp -

c# - Roxy file manager in MVC doesn't accept session path -