render image using datauri in javascript

I am trying to load an image using AJAX that is sent as data uri. Everything works fine as long as image is < 32kb. Some of the images are large in size around 500 kb. I did some research on this and found that IE8 supports only images < 32kb to be loaded using datauri.

Is there any workaround to load the image which is > 32kb or am i missing something here?

Answers


Data URI scheme

Internet Explorer 8: Microsoft has limited its support to certain "non-navigable" content for security reasons, including concerns that JavaScript embedded in a data URI may not be interpretable by script filters such as those used by web-based email clients. Data URIs must be smaller than 32 KiB in Version 8.[3] Data URIs are supported only for the following elements and/or attributes:[4]

  • object (images only)
  • img
  • input type=image
  • link (data URI must be base64 encoded)
  • CSS declarations that accept a URL, such as background-image, background, list-style-type, list-style and similar.

Internet Explorer 9: Internet Explorer 9 does not have 32KiB limitation and allowed in broader elements.


Yes, serve it as MHTML using some commentring tricks, described here and here.


You could load the image data into a canvas element. For IE8 you should have a look at How can I use the HTML5 canvas element in IE?


Need Your Help

Combining results from hadoop map-reduce

java hadoop mapreduce

I have a Mapper&lt;AvroKey&lt;Email&gt;, NullWritable, Text, Text&gt; which effectively takes in an Email and multiple times spits out a key of an email address and a value of the field it was foun...

Securing Elmah RSS Feeds in ASP.NET website

asp.net security rss elmah

I followed the answer to this question Securing Elmah in ASP.NET website to restrict access to the elmah handler. However, it seems that adding an RSS feed to Outlook for the URL elmah.axd/rss or e...