原因是因为自己的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="width: 700px; text-align: center; border-style: ridge;
border-width: 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>
}