1
如何從自動發佈的表單發送xlsx文件?代碼會解釋我的意思:用jquery發送生成文件
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>
任何想法,該怎麼辦呢?