How to get around IE8 32k limit on data:uri on base64 encode?

I need to send an html response to the browser containing a 1920x1080 png. It's a screenshot taken by an html query.

I encode the image in base64 and sends it embedded as an text/html content-type. Something simple like :

<HTML><HEAD>Whatever</HEAD><BODY><img src="data:image/png;base64,data"/></BODY></HTML>

It works fine on FF and Chrome, the problem is I need to support IE8. IE8 as a limit on the length of the data:uri.

If I compress the image so the png encoding is under 32k (about 600x500) I lose too much information.

What would be the easiest work around for this problem? (I don't have access to a server to host the image or such)

20
задан Martin 27 August 2010 в 17:34
поделиться

3 ответа

Вы всегда можете разбить изображение на 4 (или более) части и закодировать каждую часть отдельно.

4
ответ дан 30 November 2019 в 01:08
поделиться

Не могли бы вы просто сохранить образ где-нибудь, вернуть его путь, а затем изменить src на путь, который вы только что сгенерировали?

0
ответ дан 30 November 2019 в 01:08
поделиться

В конце концов мы отказались от поддержки IE8.

К счастью, это только для внутренней отладки.

Тем не менее, проблема осталась. Надеемся, что в IE9 не будет ограничения данных: uri.

17
ответ дан 30 November 2019 в 01:08
поделиться
Другие вопросы по тегам:

Похожие вопросы: