Guest User

Untitled

a guest
Dec 11th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. string fileName = Path.GetFileName(entity.file.FileName).Substring(0, entity.file.FileName.Length - 4);
  2. string directory = Path.Combine(@"~C:UsersArturDocumentstesting" + fileName);
  3. fileName = Path.GetFileName(entity.file.FileName);
  4. Directory.CreateDirectory(HttpContext.Current.Server.MapPath(directory));
  5. string path = Path.Combine(HttpContext.Current.Server.MapPath(directory), fileName);
  6.  
  7. entity.file.SaveAs(path);
  8.  
  9. string name = Path.GetFileNameWithoutExtension(fileName);
  10. string myfile = name + "_" + tbl.Id + ext;
  11.  
  12. var path = Path.Combine(Server.MapPath("~/Img"), myfile)
Add Comment
Please, Sign In to add comment