I need to copy an image file from canvas and save it to photos in iphone using phonegap. I use the js file 
 <https://github.com/devgeeks/Canvas2ImagePlugin/tree/master/www>

```
 <div class="win-n-lose-wrapper" id="workbox">
   <div class="left-img"><img id="winner" src="img/img-1.jpg" alt=""></div>
   <div class="right-img"><img id="looser" src="img/img-2.jpg" alt=""></div>
   <canvas id="mycanvas" style="display:block;"></canvas>
 </div>   
 <div class="next-wrapper">
   <a class="btn_back" title="back" onclick="goBack();">Back</a>
   <a class="btn" title="Next" onclick="share();">Copy</a>
 </div>

</body>

```

and here is the code rest

```
function share()
{

   var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");

   $('.save').attr({
                'download': 'image.png',  /// set filename
                'href'    : image              /// set data-uri
                });
}

```

I have not done any settings for this.