public JsonResult DeleteFile(string id)
        {
            if (String.IsNullOrEmpty(id))
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(Json(new { Result = "Error" }));
            }
            try
            {
                Guid        guid       = new Guid(id);
                FileDetails fileDetail = _context.FileDetails.Find(guid);
                if (fileDetail == null)
                {
                    Response.StatusCode = (int)HttpStatusCode.NotFound;
                    return(Json(new { Result = "Error" }));
                }

                //Remove from database
                _context.FileDetails.Remove(fileDetail);
                _context.SaveChanges();

                //Delete file from the file system
                //var path = Path.Combine(Server.MapPath("~/wwwroot/uploads/"), fileDetail.Id + fileDetail.Extension);
                var path = Path.Combine(
                    Directory.GetCurrentDirectory(),
                    "wwwroot\\uploads", fileDetail.FileName);
                if (System.IO.File.Exists(path))
                {
                    System.IO.File.Delete(path);
                }
                return(Json(new { Result = "OK" }));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }