0

In FF and Chrome we can send image data to server via this code:

canvas.toDataURL("image/png");

and then this base 64 string is decoded and extracted on server. I have the issue in IE now. Right now I have the image in "img" control like:

<img src="http://static.adzerk.net/Advertisers/12f0cc69cd9742faa9c8ee0f7b0d210e.jpg" />

I want to send the this image data (not src) to server in IE 8, 9. Can you help me doing the same? Any pointers to achieve it?

Rocky Singh
  • 15,128
  • 29
  • 99
  • 146

1 Answers1

0

As you know it is pretty hard to do this without a canvas (not supported in IE8/IE9). What version of ASP.NET is your server? I would think to solve this is by writing a controller action that can take a source URL to an image. The action could download the image and convert it to base64, then send it where you need.

jstromwick
  • 1,206
  • 13
  • 22
  • For that I went to http://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript but that says I have to use "canvas" which is not supported for IE8, IE9 – Rocky Singh Jun 20 '13 at 20:48
  • My intention was to point to the second answer by Sunny which has a solution that will work with those versions of IE! – jstromwick Jun 20 '13 at 21:06
  • From where I will get input data. I just have image and its src. – Rocky Singh Jun 20 '13 at 21:10