I\'ve got the following code in my Javascript:
var reader = new FileReader();
reader.onloadend = function () {
alert(reader.result);
};
You can try splitting your data using ;base64,.
// In here you are getting the data type. Ex - png, jpg, jpeg, etc. You can use this for any further purposes.
var dataType = reader.result.split(';base64,')[1];
// In here you are getting the base64 string and you can use this for your purpose.
var base64result = reader.result.split(';base64,')[1];