6

I have an image as data url and want my browser to download it as an image. The function below helps me to solve this problem (it gets the data url via the 'data' argument):

function(data) {
    var link = document.createElement("a");
    link.download = "picture.jpg";
    link.href = data;
    link.click();
}

As the data url size is less than 2 MB it is working fine in chrome. As soon as the data url size is getting greater than 2 MB, chrome wants to download a file named "Download" and than chrome shows a network failure.

I think that is because of any max cache size limitations (see getting max Data-Uri size in Javascript). Is there any possibility to increase this max size for data urls in my browser?

Community
  • 1
  • 1
pexmar
  • 331
  • 2
  • 12

0 Answers0