コード例 #1
0
        public ActionResult Layouts(HttpPostedFileBase file)
        {
            // Verify that the user selected a file
            if (file != null && file.ContentLength > 0)
            {
                InventioLayout layout = new InventioLayout();
                layout.Title      = Path.GetFileName(file.FileName);
                layout.PreviewUrl = string.Empty;
                layout.Body       = BytesHelper.StreamToByteArray(file.InputStream);

                PagesManager.AddLayout(layout);
            }

            return(RedirectToAction("Layouts"));
        }