passing base64 image string in xml tag

I tried this code, but it is not working. Any suggestions or any solutions for above issue for sending base64 string in xml tag.
I have searching lot of about base64 string passing to java server using this xml tags(i.e. xml parsing) but not get any results.

function fileSelectedForLogo() {
    var oFile = document.getElementById('image_file').files[0];
	if(oFile.size/1024 <= 50){
    var oImage = document.getElementById('preview');
    var oReader = new FileReader();
	 oReader.onload = function(e){
        oImage.src =;
		var resultStr = oImage.src;
		var result = resultStr.split(",");
		alert(" Please Upload Less 50 KB ")

function creatingXMLRequest(){
      var Name =	$('#Name').val();
      var logoImage		=  $('#LogoImageKey').val();
      var xml="<Request>" +
               "<Data>" +
               "</Data>" +

function ifValueInsert(value , tagName)
	alert(value+" == "+tagName)
	if(value!=undefined && value!='' && value!=null)
		return "<"+tagName+">"+value+"</"+tagName+">";
	return "";
<script src=""></script>
<input type="hidden" id="LogoImageKey" value="" />
    <label id="lblupload">Image Upload:</label>
    <input id="image_file" type="file" onChange="fileSelectedForLogo();" />
<input type="button" onClick="creatingXMLRequest();" value="Submit" />

Source: xml

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.