title: Uploading/Saving videos to database or file system
body: <p>I have never tried to save a video before so I don't know much about this. I know if the video is small I can convert to byte array and save to db, however to be more efficient I would like to learn how to save any uploaded video(s) to my servers file and then just save the file path of the video in my database table. I have absolutely no idea how to begin to do this. I've seen this example below but not too sure what its doing. To me it appears it's saving any uploaded videos that any user uploads to the App_Data folder. Is that right? Any help is greatly appreciated.</p>
  
  <pre><code>[HttpPost]
  public ContentResult UploadFiles()
  {
         var r = new List&lt;ViewDataUploadFilesResult&gt;();
  
         foreach (string file in Request.Files)
         {
          HttpPostedFileBase hpf = Request.Files[file] as HttpPostedFileBase;
          if (hpf.ContentLength == 0)
          continue;
  
      string savedFileName = Path.Combine(Server.MapPath("~/App_Data"), Path.GetFileName(hpf.FileName));
      hpf.SaveAs(savedFileName); // Save the file
  
      r.Add(new ViewDataUploadFilesResult()
      {
          Name = hpf.FileName,
          Length = hpf.ContentLength,
          Type = hpf.ContentType
      });
  }
  // Returns json
  return Content("{\"name\":\"" + r[0].Name + "\",\"type\":\"" + r[0].Type + "\",\"size\":\"" + string.Format("{0} bytes", r[0].Length) + "\"}", "application/json");
  }
  </code></pre>