Note that there are some explanatory texts on larger screens.

plurals
  1. POFile upload problem/bug in MVC 3
    primarykey
    data
    text
    <p>I'm having the weirdest problem with file uploads in ASP.NET MVC 3. When I start a new project with the default project template (Internet application) with Razor and add the following to /views/home/index.cshtml</p> <pre><code>&lt;form action="/Home/Index" method="post" enctype="multipart/form-data"&gt; &lt;input type="file" name="upfile" /&gt; &lt;input type="submit" value="post" /&gt; &lt;/form&gt; </code></pre> <p>the upload fails (firebug shows status 'Aborted') whenever I try to upload a file. Some extra info:</p> <ul> <li>Windows 7 / 64bit</li> <li>Cassini</li> <li>VS SP1</li> <li>It happens in both Firebug 6.0.2 and IE8</li> </ul> <p>Controller code:</p> <pre><code>public class HomeController : Controller { public ActionResult Index() { ViewBag.Message = "Welcome to ASP.NET MVC!"; return View(); } public ActionResult About() { return View(); } </code></pre> <p>}</p> <p>I've been debugging this for a bit and already found out the following:</p> <ul> <li>it only happens for files > ~120kb</li> <li>if I add a target Action with attribute [HttpPost] upload succeeds</li> <li>if I debug using fiddler (proxy) upload succeed</li> <li>if I use aspx and add the same code, upload succeeds</li> <li>for aspx/razor, all file are identical, except for (of course) the files in /Views but not /Views/Web.config</li> </ul> <p>Has anyone else experienced this problem, and what is causing it?</p> <p><strong>update:</strong> I know I should use a separate action and mark it with HttpPost, that's not why I'm asking this question. I'm looking for the <strong>reason</strong> why this doesn't work, not how to solve it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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