I want the canvas content to be saved as an image upon clicking a button. The button's OnClientClick() is attached to the following method. What it does is, it downloads the image and hence I needed an element of which the id is "link".
Can someone help me to get it saved to a location that I want ? I mean, I need to be able to specify the location for the file.
  <script type="text/javascript">
    function CanvasToImage() {
        var dataURL = can.toDataURL('image/png');
        document.location.href = dataURL.replace("image/png", "image/octet-stream");
        link.download = "test.png";
        link.href = canvas
            .toDataURL("image/png")
            .replace("image/png", "image/octet-stream");
        link.click();
    }
</script>
 
    