Skip to content

Instantly share code, notes, and snippets.

@bleroy
Created April 1, 2015 23:46
Show Gist options
  • Save bleroy/891e13e3472cf9e26164 to your computer and use it in GitHub Desktop.
Save bleroy/891e13e3472cf9e26164 to your computer and use it in GitHub Desktop.
CodePlex Issue #16507 Plain Text Attachments
# HG changeset patch
# User Sipke Schoorstra <sipke@skywalkersd.net>
# Date 1358640126 -3600
# Branch 1.x
# Node ID 9031fce4bc798ea01ec2d207c64a2d84b6a24945
# Parent 3b2d1e68942d4a256227bc014fe486ec5abbb464
#19205: Adding enctype attribute to form to support file uploads.
Work Item: 16507
diff -r 3b2d1e68942d -r 9031fce4bc79 src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml
--- a/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml Fri Dec 14 21:53:32 2012 +0100
+++ b/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml Sun Jan 20 01:02:06 2013 +0100
@@ -9,7 +9,7 @@
Layout.Title = (string)pageTitle.Text;
}
-@using (Html.BeginFormAntiForgeryPost(Url.Action("Create", new { ReturnUrl = Request.QueryString["ReturnUrl"] }))) {
+@using (Html.BeginFormAntiForgeryPost(Url.Action("Create", new { ReturnUrl = Request.QueryString["ReturnUrl"] }), FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
diff -r 3b2d1e68942d -r 9031fce4bc79 src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml
--- a/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml Fri Dec 14 21:53:32 2012 +0100
+++ b/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml Sun Jan 20 01:02:06 2013 +0100
@@ -8,7 +8,7 @@
Layout.Title = pageTitle;
}
-@using (Html.BeginFormAntiForgeryPost()) {
+@using (Html.BeginFormAntiForgeryPost(Url.Action("Edit"), FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment