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

  • 相关阅读:
    软件RAID 0
    逻辑卷管理lvm
    磁盘配额quota
    合并 CentOS 6.8 的两个ISO镜像
    挂载mount
    非交互式添加分区
    磁盘分区-gdisk用法
    C博客作业01--分支、顺序结构
    C语言--第0次作业
    浅议正则表达式
  • 原文地址:https://www.cnblogs.com/lewisli/p/2523956.html
Copyright © 2011-2022 走看看