我想在ASP.NET-MVC和angularjs中上传文件。如何使用HTML输入文件控件上传文件? [英] I want to upload file in ASP.NET-MVC and angularjs. How can I upload the file using HTML input file control?
本文介绍了我想在ASP.NET-MVC和angularjs中上传文件。如何使用HTML输入文件控件上传文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I want to upload file in asp.net-mvc And AngularJS. How can I upload the file using html input file control?
我尝试过:
What I have tried:
@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="file" name="file" />
<input type="submit" value="OK" />
}
推荐答案
@using(Html.BeginForm("UploadFile","Upload", FormMethod.Post, new { enctype="multipart/form-data"}))
{
<div>
@Html.TextBox("file", "", new { type= "file"}) <br />
<input type="submit" value="Upload" />
</div>
}
这篇关于我想在ASP.NET-MVC和angularjs中上传文件。如何使用HTML输入文件控件上传文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文