开发者

Inline base64 encoded link not working in Firefox

开发者 https://www.devze.com 2022-12-24 19:43 出处:网络
I have this link: <a href=\"data:application/pdf;base64,JVBERi0x...KJSVFT0YK\">PDF</a> In Safari on MacOsX, clicking the link instantly opens the PDF. In Firefox 3.6.2, it doesn\'t. Whe

I have this link:

<a href="data:application/pdf;base64,JVBERi0x...KJSVFT0YK">PDF</a>

In Safari on MacOsX, clicking the link instantly opens the PDF. In Firefox 3.6.2, it doesn't. When I choose Download, it saves it as "u7WYuJME.pdf(2).part", which is a valid PDF file. When I choose "Open with Preview", it down开发者_如何学JAVAloads it but does not open it. Can I change something so that Firefox opens it correctly?


Firefox is like that for any data, not only to pdf

See a browser support chart here (the site itself is not related, but it explains your problem)

Firefox 3.0+

Filename is random alphanumeric with ".part" extension

Firefox generates filenames such as a5sZQRsx.zip.part, and Safari isn't much better with just Unknown. Sadly there is no pure Javascript solution to this. However...

0

精彩评论

暂无评论...
验证码 换一张
取 消