• <bdo id='vpmPO'></bdo><ul id='vpmPO'></ul>

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

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

      1. <legend id='vpmPO'><style id='vpmPO'><dir id='vpmPO'><q id='vpmPO'></q></dir></style></legend>

        HTTP“内容处置:附件"并在 iOS 网络浏览器上下载文件

        时间:2023-07-08

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

            • <legend id='d6wuf'><style id='d6wuf'><dir id='d6wuf'><q id='d6wuf'></q></dir></style></legend>

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

                • 本文介绍了HTTP“内容处置:附件"并在 iOS 网络浏览器上下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我希望我的用户能够下载 PDF 文件并让浏览器将其视为文件,而不仅仅是显示它(即它有一个文件名,用户可以选择保存等).以下标头似乎适用于除 iOS 之外的任何地方:

                  I want my users to be able to download a PDF file and have the browser treat it as a file, not just display it (i.e. it has a filename, user gets option to save, etc.). The following header seems to work well for this everywhere except for iOS:

                  Content-Disposition: attachment; filename=file.pdf
                  

                  iOS 只是忽略这一点并显示图像或文档.没什么大不了的,你可能会想,只是我在一个隐藏的 IFRAME 中执行此操作,作为我下载页面的一部分,所以该文档甚至从未见过,而且看起来下载失败了.

                  iOS just ignores this and displays the image or document. No big deal, you might think, except I'm doing this in a hidden IFRAME as part of my download page, so the document is never even seen, and it looks like the download failed.

                  以跨浏览器兼容的方式处理此问题的最佳方法是什么?iOS 是否只是忽略此标头?我在任何地方都找不到任何规范或提及.

                  What's the best way to handle this in a cross-browser compatible manner? Does iOS just ignore this header? I can't find any spec or mention of this anywhere.

                  我是否需要在请求标头中检查 iOS 并以不同的方式提供响应?我希望避免这种情况.谢谢.

                  Do I need to check for iOS in request headers and serve the response differently? I was hoping to avoid this. Thanks.

                  附:感谢您在 iOS 网络浏览器中下载文件等任何其他有用的提示.

                  P.S. Any other helpful tips related to downloading files etc. in iOS web browsers are appreciated.

                  澄清:这是关于移动 Safari 浏览器浏览的常规网站.不是原生应用.

                  CLARIFICATION: This regarding a regular web site browsed by the mobile Safari browser. Not a native app.

                  推荐答案

                  移动端Safari浏览器不支持下载文件

                  The mobile Safari browser doesn't support downloading files.

                  如果 Safari 可以显示它,它将显示.如果您安装了其他可以打开该文件的应用程序,Safari 会为您检测到.

                  If Safari can display it, it will display. If you have installed other apps that can open the file, Safari will detect it for you.

                  这篇关于HTTP“内容处置:附件"并在 iOS 网络浏览器上下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:我的按钮的 titleLabel 变成了“..."在 iOS10 上 下一篇:UIImage 从服务器逐步显示

                  相关文章

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

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

                      <tfoot id='j5QKD'></tfoot>
                      • <bdo id='j5QKD'></bdo><ul id='j5QKD'></ul>