I had to do a lot of trial and error, until I found out that adding "responseType" as "arraybuffer" would do the trick.