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

  • 相关阅读:
    mac 安装mysql. 使用brew install mysql 报错
    当忙碌成为借口的时候
    MySQL数据库导入导出详解[转发]
    一些模拟浏览器自动Post到服务器的工具(备忘)
    [转]一句css代码让你的网站变灰,一起悼念地震中逝去的生命!
    MYSQL命令行常用操作
    国外达人收集的Cheet Sheet
    SQL Server:将6字节的十六进制页面号转化成【文件号:页面号】格式函数
    javaWEB核心
    电商
  • 原文地址:https://www.cnblogs.com/lewisli/p/2523956.html
Copyright © 2011-2022 走看看