Unblock (jQuery BlockUI) after file sent to browser through response stream

戏子无情 提交于 2019-12-06 11:17:40
Dave Walker

An idea could be to create a child window that does the PDF loading and let the parent figure out when the child window has closed or something.

Is it possible for parent window to notice if child window has been closed?

Markive

The solution is to first block the UI as normal. Then make an AJAX request to your report generator, when the PDF is generated store it locally for a short time, or have it in a temporary folder that is cleared out when the user logs out or their login times out. Have the report generator return a success message and a URL.

Have the client ajax request handle the success message, remove BlockUI, then call the URL using:

window.location="http://yourURL/temp/report.pdf

The browser will start to download the file and you are done!

https://stackoverflow.com/a/7660817/181197

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!