-1

Here's the thing, I generate a PNG image in the application and I get an Image object with JavaScript, something like this...

var img = new Image();
img.src = 'data:image/png;base64,' + base64Img;

I want to save that image to the internal storage. Is there a plugin or a way I can do this?

Kurtz
  • 85
  • 8

2 Answers2

0

 function onPhotoDataSuccess1(imageData) { 
        alert(imageData);
        sessionStorage.setItem("img_api",imageData);
        $('#largeImage').attr('src','data:image/jpeg;base64,' + imageData);
    }

Hope, it will helps you!

san
  • 214
  • 1
  • 10
0

According THIS QUESTION:

This is file download code which can be used by anyone. You just have three parameters to use this like-

1) URL

2) Folder name which you want to create in your Sdcard

3) File name (You can give any name to file)

All types of file can download by using this code. you can use this as .js And this works on IOS also.

  • First step check parameters mismatch and checking network connection if available call download function

  • Second step to get Write permission and Folder Creation

  • Third step for download a file into created folder

Also check this link

Community
  • 1
  • 1
Jordi Castilla
  • 26,609
  • 8
  • 70
  • 109