Image Data via Ajax - how can I display the image on the Page

Posted by Mike B on Stack Overflow See other posts from Stack Overflow or by Mike B
Published on 2011-01-14T15:43:36Z Indexed on 2011/01/14 15:53 UTC
Read the original article Hit count: 285

Filed under:
|
|

I am creating a Domino Document via AJAX that contains a photo. I am able to get the base64 image data back to the server in a Notes Domino Document.

Data is stored in a Richtext (textarea) field as

"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAFA..........." - (this goes on for several lines)

I am trying to display on the Domino Webpage using passthru tag

<<image id= "pic1" >>

in the onLoad event of the Form i try to shove the data into the image element using this code:

//Photo Stuff
alert(document.forms[0].photo1.value);
document.getElementById("pic1").src = document.forms[0].photo1.value;

The alert is showing the data. Picture is not appearing.

Please help.
Thanks
Mike

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about image