public ActionResult CreateStreaming([Bind(Include = "Title,File")] FileViewModel fileModel)
        {
            if (ModelState.IsValid)
            {
                var file = new FileModel {
                    Title = fileModel.Title
                };
                db.FileModels.Add(file);
                db.SaveChanges();

                VarbinaryStream blob = new VarbinaryStream(
                    System.Configuration.ConfigurationManager.ConnectionStrings["SqlFileStreamsContext"].ConnectionString,
                    "Files",
                    "File1",
                    "Id",
                    file.Id);

                Debug.WriteLine("Total length: " + fileModel.File.InputStream.Length);
                fileModel.File.InputStream.CopyTo(blob, 16080);

                return(RedirectToAction("Index"));
            }

            return(View(fileModel));
        }
        public ActionResult CreateStreaming([Bind(Include = "Title,File")] FileViewModel fileModel)
        {
            if (ModelState.IsValid)
            {

                var file = new FileModel { Title = fileModel.Title };
                db.FileModels.Add(file);
                db.SaveChanges();

                VarbinaryStream blob = new VarbinaryStream(
                                System.Configuration.ConfigurationManager.ConnectionStrings["SqlFileStreamsContext"].ConnectionString,
                                "Files",
                                "File1",
                                "Id",
                                file.Id);

                Debug.WriteLine("Total length: " + fileModel.File.InputStream.Length);
                fileModel.File.InputStream.CopyTo(blob, 16080);

                return RedirectToAction("Index");
            }

            return View(fileModel);
        }