Convert image to base64 without canvas

I need to convert an image to base64 encoding. I know its very easy with canvas. but the problem is that it should also run in IE8. but IE8 dont support HTML5 so i can't do it using canvas. Is there any other method using javaScript to convert image to base64 ?

Thanks

Answers:

Answer

There are some answers given here

How can you encode a string to Base64 in JavaScript?

have you tried any of them?

Answer

Simple answer is no if this needs to be done on client side. The canvas element is the only way to convert an image to bitmap data or data-uris (and even then security restriction may apply preventing this).

You can maybe get around this using Flash but of course that would require the client to have Flash installed.

Or setting up an external web service where you can upload the image and have it return the data you need.

For IE8 and lower there are no options out of the box (exCanvas gives you canvas drawing capabilities but can't provide bitmap data which is needed here). Basically, for IE8 you will need a server.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.