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>
        }

  • 相关阅读:
    ffplay 2.5.3 媒体播放器
    MinGW/MSYS 交叉编译环境搭建
    python chm 中文帮助 (2.7 和 3.4)
    wx.html2.WebView在 target="_blank" or rel="external" 没有反映的解决方法
    韩星5,6号 一锅双星技巧
    暖房子工程
    CStringUtf8ToUnicode
    燃气灶中心炉芯帽子生锈了,如何拆不下来?
    翻窗户消失的百岁老人/百岁老人跷家去 中文字幕
    CPinyin unicode汉字查找拼音(支持多音字)
  • 原文地址:https://www.cnblogs.com/lewisli/p/2523956.html
Copyright © 2011-2022 走看看