Save base64 string as image using phone saver?

I get the base64 string from the server for the png file, and I would like to save this image in the file system. It seems that Phonegap file manager only supports binary file. Does anyone know how I can convert this base64 string to use in a phone stumble. I looked at window.atob and window.btoa, but could not understand the meaning.

+4
source share
4 answers

You cannot use PhoneGap FileWriter to write binary data. You will need to write a plugin to send base64 encoded data to your home side, encode it in binary format, and then write it using your own code.

View the plugin information at HERE , also look at the source code of the phone to see how we do it, and you can add some code to do base64 decoding before recording.

+2
source

, . phonegap.
Canvas2Image , . canvas, base64 . javascript , base64 canvas.

0

, dataUrl, base64, png- Android.

0

BASE64 .

Phonegap Image Resizer

window.imageResizer.storeImage(
  function(json) { 
    console.log('Saved to ' + json.url) 
  }, function (error) {
    console.log("Error : \r\n" + error);
  }, imageDataInBase64);

. imageresize.js

0

Source: https://habr.com/ru/post/1524238/


All Articles