0

Imagine opening an image file on your computer with notepad. I am trying to get the same result from an img tag or an Image object with javascript. Is this possible?

Bob
  • 185
  • 1
  • 4
  • 13
  • 1
    I am morbidly curious as to what you are trying to accomplish! Check out: http://stackoverflow.com/questions/7370943/retrieving-binary-file-content-using-javascript-base64-encode-it-and-reverse-de – Matt Feb 15 '13 at 16:19
  • this might be what you're after, base64 representation of hte image ... http://stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-using-javascript – Alex Feb 15 '13 at 16:20
  • Is this what you are looking for? http://stackoverflow.com/questions/5420384/convert-an-image-into-binary-data-in-javascript – naomi Feb 15 '13 at 16:20
  • @Xander So if the image is really a plain text file, could I recover that text from an img tag or Image object? – Bob Feb 16 '13 at 00:13

1 Answers1

0

You can send an AJAX request to the image URL on the server.

If the server sends good caching headers, that won't even waste bandwidth.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964