public ActionResult Create(File file)
        {
            if (ModelState.IsValid)
            {
                db.Files.Add(file);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.TypeID = new SelectList(db.Types, "TypeID", "Extension", file.TypeID);
            ViewBag.UserID = new SelectList(db.Users, "UserID", "Username", file.UserID);
            ViewBag.FolderID = new SelectList(db.Folders, "FolderID", "FolderName", file.FolderID);
            return View(file);
        }
 public ActionResult Edit(File file)
 {
     if (ModelState.IsValid)
     {
         db.Entry(file).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.TypeID = new SelectList(db.Types, "TypeID", "Extension", file.TypeID);
     ViewBag.UserID = new SelectList(db.Users, "UserID", "Username", file.UserID);
     ViewBag.FolderID = new SelectList(db.Folders, "FolderID", "FolderName", file.FolderID);
     return View(file);
 }