与asp.net中几乎一样,使用表单提交的方式上传文件(如果是使用了第三方插件的话,那么就另当别论)

@{
    ViewBag.Title = "Index";
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>@ViewBag.Title</title>    
</head>
<body>
    <form id="form1" method="post"  enctype="multipart/form-data" action="@Url.Action("SaveFiles")">
        <input type="file" name="file" value="" />
        <br />
        <input type="submit" value="提交" /> 
    </form>
</body>
</html>
View中的代码

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2021-12-24
  • 2021-07-29
  • 2021-11-21
  • 2022-01-06
猜你喜欢
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
相关资源
相似解决方案