Write Raw Binary to System Phonegap / Cordova file

I am using an API in my application that returns an image in binary. I am trying to write this to a file using cordova fileWriter.

Assuming the var data

returned binary contains. I can successfully write this to the filesystem ( writer.write(data);

). However, the image is damaged and won't open.

Do I need to do something with the data received before writing it? Maybe turn it into something ?, I'm not familiar with binary data management. Would be grateful for any help


source to share

All Articles