public async Task<IActionResult> Index(Utils.FileUpload m)
        {
            BindControls();
            if (ModelState.IsValid)
            {
                m.Set(".rar|.txt|.pdf|.doc|.jpeg|.jpg|.gif", 2);
                var isok = await m.SaveFileAsAsync(HttpContext);
                if (isok)
                {
                    //todo your code

                }
                else { ModelState.AddModelError("", m.ErrorMessage); }
            }
            return View(m);
        }
 public IActionResult JsUpload(Utils.FileUpload upload)
 {
     if (ModelState.IsValid)
     {
         //upload.Set("")
         if (upload.SaveFileAsAsync(HttpContext).Result)
             return Json(new { ret = 1, src = upload.TargetFilePath });
         else
             return Json(new { ret = 0, msg = upload.ErrorMessage });
     }
     else
         return Json(new { ret = 0, msg = ModelState.ExpendErrors() });
 }