同步上传
多余的话不用讲,我们直接看页面。
<div class="container">
<div>
@if (ViewBag.Success != null)
{ <div class="alert alert-danger" role="alert">
<strong>成功啦 !</strong> 成功上传. <a href="/[email protected]" target="_blank">open file</a>
</div>
} else if (ViewBag.Failed != null)
{ <div class="alert alert-danger" role="alert">
<strong>失败啦 !</strong> @ViewBag.Failed </div>
} </div>
@using (Html.BeginForm("SyncUpload", "Home", FormMethod.Post, new { role = "form", enctype = "multipart/form-data", @style = "margin-top:50px;" }))
{ <div class="form-group">
<input type="file" id="file" name="file" />
</div>
<input type="submit" value="Submit" class="btn btn-primary" />
}</div><div class=