• <i id='ZZ7gB'><tr id='ZZ7gB'><dt id='ZZ7gB'><q id='ZZ7gB'><span id='ZZ7gB'><b id='ZZ7gB'><form id='ZZ7gB'><ins id='ZZ7gB'></ins><ul id='ZZ7gB'></ul><sub id='ZZ7gB'></sub></form><legend id='ZZ7gB'></legend><bdo id='ZZ7gB'><pre id='ZZ7gB'><center id='ZZ7gB'></center></pre></bdo></b><th id='ZZ7gB'></th></span></q></dt></tr></i><div id='ZZ7gB'><tfoot id='ZZ7gB'></tfoot><dl id='ZZ7gB'><fieldset id='ZZ7gB'></fieldset></dl></div>

        <small id='ZZ7gB'></small><noframes id='ZZ7gB'>

        <tfoot id='ZZ7gB'></tfoot>
        • <bdo id='ZZ7gB'></bdo><ul id='ZZ7gB'></ul>
      1. <legend id='ZZ7gB'><style id='ZZ7gB'><dir id='ZZ7gB'><q id='ZZ7gB'></q></dir></style></legend>

        通过 XHR 请求下载 PDF 文件

        时间:2023-10-13

          <tfoot id='41nlZ'></tfoot>

          <i id='41nlZ'><tr id='41nlZ'><dt id='41nlZ'><q id='41nlZ'><span id='41nlZ'><b id='41nlZ'><form id='41nlZ'><ins id='41nlZ'></ins><ul id='41nlZ'></ul><sub id='41nlZ'></sub></form><legend id='41nlZ'></legend><bdo id='41nlZ'><pre id='41nlZ'><center id='41nlZ'></center></pre></bdo></b><th id='41nlZ'></th></span></q></dt></tr></i><div id='41nlZ'><tfoot id='41nlZ'></tfoot><dl id='41nlZ'><fieldset id='41nlZ'></fieldset></dl></div>
        1. <small id='41nlZ'></small><noframes id='41nlZ'>

            <tbody id='41nlZ'></tbody>

            • <bdo id='41nlZ'></bdo><ul id='41nlZ'></ul>
                  <legend id='41nlZ'><style id='41nlZ'><dir id='41nlZ'><q id='41nlZ'></q></dir></style></legend>
                1. 本文介绍了通过 XHR 请求下载 PDF 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  通过 XHR 请求下载 pdf 文件是完全不可能的吗?我知道已经有很多关于这个话题的其他讨论,但遗憾的是,我仍然对它们不满意.我正在使用 AngularJs 并使用其 $Http 方法发出请求.它不返回任何文件下载弹出窗口.但是,如果我在新的浏览器窗口中使用相同的 URL,那么我会得到一个弹出窗口.我已经尝试过一个工作区,它的工作正常,即 document.location.href = url; 但如果我这样做,那么在下载弹出窗口准备好之前,我无法显示等待图像并出现了.所以周围的工作对我来说是不够的.我想以一种真正的方式通过向服务器发出请求来完成它,通过它我也可以处理结果的替代流程.

                  Is it totally impossible to download a pdf file through an XHR request? I know there are many other discussions already on this topic but sadly, I am still not satisfied with them. I am using AngularJs and making a request by using its $Http method. It is not returning any file download popup. But if I hit with the same URL in a new Browser Window then I am getting a popup. I have already tried a work-arround and its working fine i.e. document.location.href = url; but If I do this then I am unable to show the waiting image till the time the download popup is ready and appeared. So the work arround is not enough for me. I would like to do it with a genuine way through a request to the server through which I can handle the alternative flows of the outcome as well.

                  推荐答案

                  看看这个JQuery插件jquery-file-download-plugin 这里是这个插件的演示页面 demo.我认为它将 iframe 动态插入到 DOM 并产生类似于 AJAX 请求的外观.可能对你有帮助.

                  Have a look at this JQuery plugin jquery-file-download-plugin and here is the demo page of this plugin demo . I think its inserting iframe dynamically to DOM and produces look and feel just like AJAX request. It might be helpful for you.

                  这篇关于通过 XHR 请求下载 PDF 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:AngularJS $http 从失败的 CORS 请求返回状态码 0 下一篇:如果 XMLHttpRequest 对象支持 W3C 进度事件,如何检

                  相关文章

                  最新文章

                  <i id='w4VFf'><tr id='w4VFf'><dt id='w4VFf'><q id='w4VFf'><span id='w4VFf'><b id='w4VFf'><form id='w4VFf'><ins id='w4VFf'></ins><ul id='w4VFf'></ul><sub id='w4VFf'></sub></form><legend id='w4VFf'></legend><bdo id='w4VFf'><pre id='w4VFf'><center id='w4VFf'></center></pre></bdo></b><th id='w4VFf'></th></span></q></dt></tr></i><div id='w4VFf'><tfoot id='w4VFf'></tfoot><dl id='w4VFf'><fieldset id='w4VFf'></fieldset></dl></div>
                    <bdo id='w4VFf'></bdo><ul id='w4VFf'></ul>
                  <legend id='w4VFf'><style id='w4VFf'><dir id='w4VFf'><q id='w4VFf'></q></dir></style></legend>

                  <small id='w4VFf'></small><noframes id='w4VFf'>

                  1. <tfoot id='w4VFf'></tfoot>