This is my Javascript code
function upload(){
var byteCharacters = atob($scope.image1.compressed.dataURL.replace(/^data:image\\(png|jpg);base64,/,
After checking out your code it seems like you have characters which are not probably supported. Check screenshot If that doesn't work make sure the name of the file you are trying to upload is encoded to what your database or settings support.
Here is the code without those characters:
var byteCharacters = atob($scope.image1.compressed.dataURL.replace(/^data:image\/(png|jpg);base64,/,'')); var byteNumbers = new Array(byteCharacters.length);