Note that there are some explanatory texts on larger screens.

plurals
  1. POThe input is not a valid Base-64 string as it contains a non-base 64 character?
    text
    copied!<p>I have a form where a user can upload a file to the sites download section. However when the form is submitted I get this error, without the request ever making it to the action method.</p> <p>"The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters."</p> <p>Code:</p> <pre><code>[HttpPost] [Authorize] public ActionResult Create(Download dl, HttpPostedFileBase DownloadFile) { </code></pre> <p>And</p> <pre><code>@model Models.Download @{ ViewBag.Title = "Add Download"; } &lt;h3&gt;Add Download&lt;/h3&gt; @using (Html.BeginForm("Create", "Download", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.ValidationSummary(true) &lt;div class="editor-label"&gt;Download File&lt;/div&gt; &lt;div class="editor-field"&gt; &lt;input name="DownloadFile" id="DownloadFile" type="file" /&gt; @Html.ValidationMessage("DownloadFile"); &lt;/div&gt; &lt;div class="editor-label"&gt;@Html.LabelFor(model =&gt; model.Downloads)&lt;/div&gt; &lt;div class="editor-field"&gt; @Html.EditorFor(model =&gt; model.Downloads) @Html.ValidationMessageFor(model =&gt; model.Downloads) &lt;/div&gt; &lt;div class="editor-label"&gt;@Html.LabelFor(model =&gt; model.DownloadDate)&lt;/div&gt; &lt;div class="editor-field"&gt; @Html.EditorFor(model =&gt; model.DownloadDate) @Html.ValidationMessageFor(model =&gt; model.DownloadDate) &lt;/div&gt; &lt;div class="display-field"&gt;&lt;input type="submit" value="Add" /&gt;&lt;/div&gt; } &lt;div&gt;@Html.ActionLink("Back To Downloads", "Index")&lt;/div&gt; </code></pre> <p>Any sugestions?</p> <p>Thanks, Alex.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload