通过HTTPS的Android 2.2和2.3 PDF下载似乎打破 [英] Android 2.2 and 2.3 PDF download via HTTPS seems broken
问题描述
我已经要疯了关于PDF下载到移动设备。这里是下一个疯狂,观察到在Android 2.2和2.3。我无法重现此问题在iPhone或其它设备,无论是在Firefox或其他桌面浏览器。
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.
我下载通过HTTP PDF文件,它工作得很好。然后,我通过HTTPS下载同一个PDF和下载未完成(与文件名丢失):
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):
我用这些HTTP标头(和其他人,这是无关紧要的位置):
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.
注:我已经发现了与不受信任的SSL证书的问题,但似乎并不被唯一的问题。所以我真正需要的又一个解释。
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.
任何想法表示欢迎!
推荐答案
与往常一样,经过一番辛苦找有有很多失意开发商的意见对谷歌code古老bug报告......这里有两个开放性问题与此相关的问题:
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:
- <一个href="http://$c$c.google.com/p/android/issues/detail?id=3492">http://$c$c.google.com/p/android/issues/detail?id=3492
- <一个href="http://$c$c.google.com/p/android/issues/detail?id=5851">http://$c$c.google.com/p/android/issues/detail?id=5851
- http://code.google.com/p/android/issues/detail?id=3492
- http://code.google.com/p/android/issues/detail?id=5851
看来,使用不受信任的SSL证书(这是在我的测试环境的情况下)下载PDF文件不符合正是我所提到的症状工作
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
更新:作为事实上,这里是整个事件的一些权威的信息,可见在当时,内容处置
是执行不力的和指定的的,这也解释了通过HTTP实现下载的时候遇到了很多问题:
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
这篇关于通过HTTPS的Android 2.2和2.3 PDF下载似乎打破的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!