I want to keep the incoming images in a list as they are loaded visually with Filepond. I'll email them later.but every time a file is called to load it creates the list again.the list is always reset.
public class HomeController : Controller
{
List<HttpPostedFileBase> img = new List<HttpPostedFileBase>();
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Fileupload()
{
try
{
if (Request.Files.Count > 0)
{
HttpPostedFileBase file = Request.Files[0];
if (file != null && file.ContentLength > 0)
{
img.Add(file);
return Json(true);
}
}
return Json(false);
}
catch
{ return Json(false); }
}