public async Task <ActionResult> MediaItem(int id) { CheckForReadOnly(); if (ModelState.IsValid) { var user = new UserManager().GetUser((int)UserID); var htmlInputProvider = new OCM.API.InputProviders.HTMLFormInputProvider(); if (user != null) { var mediaItem = new MediaItem(); var tempPath = System.IO.Path.GetTempPath() + "\\_ocm"; if (!System.IO.Directory.Exists(tempPath)) { System.IO.Directory.CreateDirectory(tempPath); } bool uploaded = await htmlInputProvider.ProcessMediaItemSubmission(tempPath, HttpContext, mediaItem, user.ID).ConfigureAwait(true); ViewBag.PoiId = id; if (uploaded) { ViewBag.UploadCompleted = true; } } } return(View("AddMediaItem")); }
public ActionResult AddMediaItem(int id, FormCollection collection) { var user = new UserManager().GetUser((int)Session["UserID"]); var htmlInputProvider = new OCM.API.InputProviders.HTMLFormInputProvider(); if (user != null) { var mediaItem = new MediaItem(); bool uploaded = htmlInputProvider.ProcessMediaItemSubmission(this.HttpContext.ApplicationInstance.Context, ref mediaItem, user.ID); ViewBag.PoiId = id; ViewBag.UploadCompleted = true; return View(); } return View(); }
public ActionResult AddMediaItem(int id, FormCollection collection) { var user = new UserManager().GetUser((int)Session["UserID"]); var htmlInputProvider = new OCM.API.InputProviders.HTMLFormInputProvider(); if (user != null) { var mediaItem = new MediaItem(); bool uploaded = htmlInputProvider.ProcessMediaItemSubmission(this.HttpContext.ApplicationInstance.Context, ref mediaItem, user.ID); ViewBag.PoiId = id; ViewBag.UploadCompleted = true; return(View()); } return(View()); }