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?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.