http://jsfiddle.net/JHQnk/1659/
How will I run this into Appery
http://jsfiddle.net/JHQnk/1659/
How will I run this into Appery
Hi Amirul Momenin.
You can use that code wherever you want.
E.g If you want to use that code on some button's "onclick" event then you can write that code in "runjavascript" action of that button.
Logan.
Not working
can you check this
var handleFileSelect = function(evt) {
Code: Select all
alert(1)
var files = evt.target.files;
var file = files[0];
if (files && file) {
var reader = new FileReader();
reader.onload = function(readerEvt) {
var binaryString = readerEvt.target.result;
data = 'data:'+file.type+';base64,'+ btoa(binaryString);
document.getElementById("base64textarea").value = data;
document.getElementById("image").src = data;
};
reader.readAsBinaryString(file);
}
};
if (window.File && window.FileReader && window.FileList && window.Blob) {
document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
} else {
alert('The File APIs are not fully supported in this browser.');
}
Send me some screenshots of how you wrote that code and where?
How will I pass event?
This is main problem
var files = event.target.files;
for(i=0;i).src = data;
alert(data)
Code: Select all
};
reader.readAsBinaryString(file);
}
}
Hi Amirul Momenin.
Thanks for details.
Is there any error in console log or is there any alert that you used for errors?
Logan.