model-view-controller - 在mvc中下载excel response.end()后有没有办法使用redirecttoaction()函数?
问题描述
在mvc中下载excel response.end()后有没有办法使用redirect to action()函数???我从很久以前就得到了这个问题,并正在寻找一个正确而好的答案??如果答案是否定的,请为此建议任何其他技术。
谢谢
解决方案
tnq 为您提供支持。参考以下链接:
我已经尝试过了。但是如果我们在 response.end() 之后使用 response.redirect,它会在发送 HTTP 标头后给出无法重定向。错误。如果我们在 response.end() 之前添加它只会重定向但之后不会下载这样的 excel 文件。
第二个解决方案:请告诉我们可以在下载文件时添加两个标题?我已经在使用 Response.AddHeader("content-disposition", "attachment;filename=QuarterlyReport.csv")。
请调查一下。
谢谢
推荐阅读
- java - 带有 Spring Boot 的 Proguard - 集成测试
- sql-server - Excel VBA - 一次插入 1000 行到 sql server
- javascript - 使用 chrome 扩展获取网页中的所有超链接标题
- amazon-cloudformation - 如何在 CF 模板中使用正则表达式作为条件
- ruby-on-rails - 如何使用 ransack 更改活动的管理员过滤器?
- c# - 如何返回获得的所有积分列表并添加/删除角色
- date - 为什么我的 RFC 2822 日期没有被 chrono 解析?
- nuxt.js - 未找到资产中的 Nuxt markdownit 图像
- javascript - How to load new cache after content updates in HTML JS?
- python - 如何使用 numpy.savetxt 函数将此数组保存到特定文件夹?