1Try this:
2
3function _base64ToArrayBuffer(base64) {
4 var binary_string = window.atob(base64);
5 var len = binary_string.length;
6 var bytes = new Uint8Array(len);
7 for (var i = 0; i < len; i++) {
8 bytes[i] = binary_string.charCodeAt(i);
9 }
10 return bytes.buffer;
11}