如何从自动发布的表单发送 xlsx 文件?代码将解释我的意思:
public ActionResult SendForm()
{
ViewBag.text1 = "some generated text";
MemoryStream ms = new MemoryStream();
// generating file...
var file = File(ms, "type")
// ?? ViewBag.XLS = file;
return View();
}
看法:
<script type="text/javascript">
$(document).ready(function () {
frmSubmit.submit();
});
</script>
<form name="frmSubmit" action="@url" method="post">
<input type="hidden" name="text1" value="@ViewBag.text1" />
</form>
知道怎么做吗?