开发者

Empty Request.Files with MVC 3 file upload

开发者 https://www.devze.com 2023-02-02 10:50 出处:网络
This is my markup: <form action=\"/Customer/Create\" enctype=\"multipart/form-data\" method=\"post\">

This is my markup:

<form action="/Customer/Create" enctype="multipart/form-data" method="post">
    <input id="file"开发者_如何学编程 type="file" style="width:300px" />
    <input type="submit" id="btnSubmit" value="Add Image to S3" />
</form>

When I step through the Create action the Request.Files is empty. I've searched and searched and all the advice seems to be about ensuring the enctype is set to "multipart/form-data" which I have already set. Any other ideas?


Try adding a name attribute to the input. I don't think nameless form items get posted at all.

0

精彩评论

暂无评论...
验证码 换一张
取 消