我该如何调用我的行动? [英] How can i invok my action ?
本文介绍了我该如何调用我的行动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
i希望使用Asp.net5 MVC6和AngularJs上传excel文件
时我想调用我的动作,paramètre为null我想发送我的excel文件,将其上传到我的存储库中
plzz我需要你的帮助
我尝试过的事情:
这个网址下面的代码
http://www.mediafire.com/view/9cb0t300rtl0h17/code.txt
hello,
i want to upload excel file using Asp.net5 MVC6 and AngularJs
when i want to invoke my action the paramètre is null i want just send my excel file to action to upload it in my repository
plzz i need your help
What I have tried:
the code below in this url
http://www.mediafire.com/view/9cb0t300rtl0h17/code.txt
推荐答案
我不打算去外部网站看看你的代码,所以我发布了通用的解决方案。
只需使用普通的表格上传文件。
I'm not going to go to an external site to look at your code, so I'm posting the generic solution.
Just use a normal form upload for your file.
<form action="@Url.Action(" uploadaction="," uploadcontroller=")">
<input type="file" />
<input type="submit" value="Upload" />
</form>
然后在你的控制器中:
Then in your controller:
public ActionResult UploadAction(HttpPostedFileBase file)
{
//Save file.InputStream to your repo
}
信息在HttpPostedFileBase上可以找到:
HttpPostedFileBase类(System.Web) [ ^ ]
这篇关于我该如何调用我的行动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文