Android 2.2和2.3通过HTTPS的PDF下载似乎坏了 [英] Android 2.2 and 2.3 PDF download via HTTPS seems broken

查看:178
本文介绍了Android 2.2和2.3通过HTTPS的PDF下载似乎坏了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力将PDF下载到移动设备。这是下一个疯狂,可以在Android 2.2和2.3中观察到。我无法在iPhone或其他桌面浏览器上复制iPhones或其他设备上的这个问题。



我正在通过HTTP下载PDF,它的工作原理很好。然后我通过HTTPS下载相同的PDF,下载没有完成(文件名丢失):





我使用这些HTTP标头(和其他,这在这里是无关紧要的):

 内容处理:附件; filename =abc.pdf
内容类型:application / pdf

code>内容处理到 inline 或完全删除它也没有帮助。删除内容类型将导致在浏览器窗口中显示原始二进制数据。



注意: ve已经发现了与不受信任的SSL证书相关的问题,但这似乎不是唯一的问题。所以我真的在寻找另一个解释。



任何想法欢迎!

解决方案

和往常一样,经过一番努力,有一个关于谷歌代码的古代bug报告,很多沮丧的开发者评论...这是两个与此问题有关的开放问题:





似乎使用不受信任的证书(在我的测试环境中是这种情况)使用SSL下载PDF并不能完全符合我提到的症状



更新:这只是一个问题。但它似乎不是唯一的一个



更新:事实上,这里是一些关于整个事物的权威信息,表明当时, Content-Disposition 执行不力,并指定,这解释了通过HTTP实现下载时遇到的许多问题:



http://greenbytes.de/tech/tc2231


I've been going nuts about PDF downloads to mobile devices. Here's the next madness, observable on Android 2.2 and 2.3. I couldn't reproduce this problem on iPhones or other devices, neither on Firefox or other desktop browsers.

I'm downloading a PDF via HTTP and it works just fine. Then I'm downloading the same PDF via HTTPS and the download doesn't finish (and the filename is lost):

I'm using these HTTP headers (and others, which are irrelevant here):

Content-Disposition: attachment; filename="abc.pdf"
Content-Type: application/pdf

Changing the Content-Disposition to inline or removing it entirely doesn't help either. Removing the Content-Type will results in displaying the raw binary data in the browser window.

Note: I've already discovered a problem related to untrusted SSL certificates, but that doesn't seem to be the only problem. So I'm really looking for yet another explanation.

Any ideas welcome!

解决方案

As always, after some hard looking there is an ancient bug report on google code with lots of frustrated developer comments... Here are two open issues related to this problem:

It seems that downloading PDFs using SSL with untrusted certificates (which is the case in my test environment) doesn't work with exactly the symptoms that I have mentioned

Update: That is only one problem. But it doesn't seem to be the only one

Update: As a matter of fact, here is some authoritative information on the whole matter, showing that at the time, Content-Disposition was poorly implemented and specified, which explains many problems encountered when implementing downloads over HTTP:

http://greenbytes.de/tech/tc2231

这篇关于Android 2.2和2.3通过HTTPS的PDF下载似乎坏了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆