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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -