By Recapture image occur error "The process cannot access the file because its used by another process."
my code is below i try to delete existing file but not successed.
- [WebMethod()]
- public static bool SaveCapturedImage(string data)
- {
- string fileName = DateTime.Now.ToString("dd-MM-yy hh-mm");
-
-
-
-
-
-
-
-
- byte[] imageBytes = Convert.FromBase64String(data.Split(',')[1]);
-
- string filePath = HttpContext.Current.Server.MapPath(string.Format("~/CapturedImage/{0}.jpg", fileName));
- File.WriteAllBytes(filePath, imageBytes);
- return true;
-