public ActionResult UploadSlide(int playlistId, ViewModel_UploadSlideToPlaylist model)
 {
     for (int i = 0; i < Request.Files.Count; i++)
     {
         HttpPostedFileBase file = Request.Files[i]; //Uploaded file
                                                     //Use the following properties to get file's name, size and MIMEType
         try
         {
             switch (file.ContentType)
             {
                 case "image/png":
                 case "image/jpg":
                 case "image/jpeg":
                     var path = Path.Combine(
                                 Server.MapPath("/Content/Uploaded_Files/Slides/"),
                                 Path.GetFileName(file.FileName));
                     file.SaveAs(path); //File will be saved in application root
                     Slide slide = new Slide
                     {
                         Name = file.FileName,
                         Path = "/Content/Uploaded_Files/Slides/" + file.FileName,
                         ContentType = file.ContentType
                     };
                     slideService.InsertSlide(slide);
                     playlistService.ConnectSlide(playlistId, slide.SlideID);
                     model.statusList.Add(new UploadPostInfo()
                     {
                         filename = file.FileName,
                         imgsrc = "/content/images/ok.png",
                         message = "File added to database"
                     });
                     break;
                 default:
                     model.statusList.Add(new UploadPostInfo()
                     {
                         filename = file.FileName,
                         imgsrc = "/content/images/notok.png",
                         message = "File type is not supported"
                     });
                     break;
             }
         } catch (Exception ex)
         {
             model.statusList.Add(new UploadPostInfo()
             {
                 filename = file.FileName,
                 imgsrc = "/content/images/notok.png",
                 message = "Could not add to database, error:" + ex
             });
         }
     }
     return PartialView("~/Views/Playlists/_UploadSlideToPlaylistPartial.cshtml", model);
 }
 public ActionResult UploadSlide(int playlistId)
 {
     ViewModel_UploadSlideToPlaylist model = new ViewModel_UploadSlideToPlaylist();
     model.playlistId = playlistId;
     return PartialView("~/Views/Playlists/_UploadSlideToPlaylistPartial.cshtml", model);
 }