Add backload for multiple file upload

This commit is contained in:
2016-01-27 11:06:47 -05:00
parent 2c73fb6883
commit 37a7a24436
261 changed files with 28994 additions and 96 deletions
+24 -2
View File
@@ -1,4 +1,6 @@
using System.Web.Mvc;
using System.IO;
using System.Linq;
using System.Web.Mvc;
using LeafWeb.Web.ViewModels.LeafInput;
namespace LeafWeb.Web.Controllers
@@ -7,13 +9,33 @@ namespace LeafWeb.Web.Controllers
{
public ActionResult Index()
{
// initialize the session storage to retain SessionID between requests
Session["placeholder"] = 0;
return View();
}
[HttpPost]
public ActionResult Index(CreateViewModel viewModel)
{
return View();
// directory name is the sessionID
var directory = Session.SessionID;
var path = Path.Combine(Server.MapPath("~/Files/"), directory + "\\");
var files = Directory.GetFiles(path);
if (!files.Any())
{
ModelState.AddModelError("", "Must select at least one file");
}
if (ModelState.IsValid)
{
// convert viewModel into Model
// load files into LeafInputFile
//
}
return View();
}
}
}