zoukankan      html  css  js  c++  java
  • MVC 图片上传总是request.files.count() 等于0

    原因是因为自己的form表单内没有添加

    enctype = "multipart/form-data"

        @using (Html.BeginForm("UpLoadImg", "FamousStory", FormMethod.Post, new { enctype = "multipart/form-data", name = "upform", id = "upform" }))
        {
            <table align="center" style=" 700px; text-align: center; border-style: ridge;
                border- 3pt">
                <th colspan="3">
                    <font color="red" size="25" align="left">单一图片分类上传</font>
                </th>
                <tr>
                    <td align="center">
                        <input type="file" id="img" name="img" xml:lang />
                        <select name="ImgSource" id="ImgSource">
                            @if (imglist != null || imglist.ToList().Count > 0)
                            {
                                foreach (var item in imglist)
                                {                                                               
                                <option value="@item.ImgSource">@item.TypeName </option>
                                }
                            }
                        </select>
                        <input type="button" value="开始上传" id="upload" name="upload" onclick="UpLoad()" xml:lang />
                    </td>
                </tr>
            </table>
        }

  • 相关阅读:
    通过json动态创建控制器
    记一次bug解决!改变思路解决问题的同时,还需要弄明白是什么原因。
    __proto__,prototype,constructor
    事件:compositionstart & compositionend,解决oninput获取到拼音的问题。
    事件绑定----阻止冒泡失效
    预装的win10系统如何恢复
    rem.js
    vscode 使用 github仓库
    nginx使用
    伸缩盒
  • 原文地址:https://www.cnblogs.com/lewisli/p/2523956.html
Copyright © 2011-2022 走看看