link creation and canvas download Image work ONLY ONE TIME in ChromeHow to get file creation & modification date/times in Python?Resizing an image in an HTML5 canvashref image link download on clickLocal image in canvas in chromeDisable to download image from canvasWhy does JavaScript only work after opening developer tools in IE once?Download generated canvas with blobsDownload Canvas Image Png Chrome/Safaridownload a canvas as an image in chrome extensionhow to double click a word in a web page by java script in browser's console

Asked to Not Use Transactions and to Use A Workaround to Simulate One

How to write characters doing illogical things in a believable way?

Why is the Digital 0 not 0V in computer systems?

In what sequence should an advanced civilization teach technology to medieval society to maximize rate of adoption?

Ambiguity in notation resolved by +

Can Feather bring back a spell with Jump-Start?

What makes a smart phone "kosher"?

Make 2019 with single digits

Parallel resistance in electric circuits

What next step can I take in solving this sudoku?

Examples of proofs by making reduction to a finite set

Does my opponent need to prove his creature has morph?

sed replacing character in a file

Permutations in Disguise

Why is the year in this ISO timestamp not 2019?

Is は a particle in こんにちは and こんばんは?

80s sci fi film with line "Paris? Bye bye!"

What are these things that surround museum exhibits called?

Amortized Loans seem to benefit the bank more than the customer

What officially disallows US presidents from driving?

What's the benefit of prohibiting the use of techniques/language constructs that have not been taught?

Telling my mother that I have anorexia without panicking her

Can a character with good/neutral alignment attune to a sentient object with evil alignment?

How does a simple logistic regression model achieve a 92% classification accuracy on MNIST?



link creation and canvas download Image work ONLY ONE TIME in Chrome


How to get file creation & modification date/times in Python?Resizing an image in an HTML5 canvashref image link download on clickLocal image in canvas in chromeDisable to download image from canvasWhy does JavaScript only work after opening developer tools in IE once?Download generated canvas with blobsDownload Canvas Image Png Chrome/Safaridownload a canvas as an image in chrome extensionhow to double click a word in a web page by java script in browser's console






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I created javascript tool that reads a photo from an input field, modifies it, resizes it and displays it on the page in an tag. Then I create a link and start the download automatically.

Everything works perfectly with Firefox, Opera, Safari, but work ONLY ONE TIME in Chrome! (not working all in IE,but is not a problem for me. Any idea?



https://jsfiddle.net/tuttoeniente/efod3avh/1/



EDIT:

ONLY ONE TIME, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.



function downloadCanvas() 
if (datoImg !== undefined)
if (!isChrome && !isIE)
//funziona per firefox, safari ed opera
var link = document.createElement("a");
document.body.appendChild(link);
link.href = datoImg;
link.download = getNomeFoto();
link.dispatchEvent(new MouseEvent('click', bubbles: true, cancelable: true, view: window));
document.body.removeChild(link);
else
//converte in blob, altrimenti chrome non codificava bene
dataURIToBlob(datoImg, callback);

else
alert("Niente da scaricare");




function dataURIToBlob(dataURI, callback)
var binStr = atob(dataURI.split(',')[1]),
len = binStr.length,
arr = new Uint8Array(len);
for (var i = 0; i < len; i++)
arr[i] = binStr.charCodeAt(i);

callback(new Blob([arr]));


//funzione utilizzata per chrome che genera link
var callback = function (blob)
var a = document.createElement('a');
a.download = getNomeFoto();
a.innerHTML = 'download';
a.href = URL.createObjectURL(blob);
a.dispatchEvent(new MouseEvent('click', bubbles: true, cancelable: true, view: window));
;









share|improve this question


























  • Can you explain what "only one time" means? What happens after that? An error? No actions? Something else?

    – Avery
    Mar 28 at 11:36











  • Does it alert Niente da scaricare the second time on chrome?

    – pokeybit
    Mar 28 at 11:37











  • ONLY ONE TIME the link download, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.

    – Federica
    Mar 28 at 11:45












  • The alert serves as a control, I only pasted the part of code inherent to this problem but the app is more complex.

    – Federica
    Mar 28 at 11:45

















0















I created javascript tool that reads a photo from an input field, modifies it, resizes it and displays it on the page in an tag. Then I create a link and start the download automatically.

Everything works perfectly with Firefox, Opera, Safari, but work ONLY ONE TIME in Chrome! (not working all in IE,but is not a problem for me. Any idea?



https://jsfiddle.net/tuttoeniente/efod3avh/1/



EDIT:

ONLY ONE TIME, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.



function downloadCanvas() 
if (datoImg !== undefined)
if (!isChrome && !isIE)
//funziona per firefox, safari ed opera
var link = document.createElement("a");
document.body.appendChild(link);
link.href = datoImg;
link.download = getNomeFoto();
link.dispatchEvent(new MouseEvent('click', bubbles: true, cancelable: true, view: window));
document.body.removeChild(link);
else
//converte in blob, altrimenti chrome non codificava bene
dataURIToBlob(datoImg, callback);

else
alert("Niente da scaricare");




function dataURIToBlob(dataURI, callback)
var binStr = atob(dataURI.split(',')[1]),
len = binStr.length,
arr = new Uint8Array(len);
for (var i = 0; i < len; i++)
arr[i] = binStr.charCodeAt(i);

callback(new Blob([arr]));


//funzione utilizzata per chrome che genera link
var callback = function (blob)
var a = document.createElement('a');
a.download = getNomeFoto();
a.innerHTML = 'download';
a.href = URL.createObjectURL(blob);
a.dispatchEvent(new MouseEvent('click', bubbles: true, cancelable: true, view: window));
;









share|improve this question


























  • Can you explain what "only one time" means? What happens after that? An error? No actions? Something else?

    – Avery
    Mar 28 at 11:36











  • Does it alert Niente da scaricare the second time on chrome?

    – pokeybit
    Mar 28 at 11:37











  • ONLY ONE TIME the link download, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.

    – Federica
    Mar 28 at 11:45












  • The alert serves as a control, I only pasted the part of code inherent to this problem but the app is more complex.

    – Federica
    Mar 28 at 11:45













0












0








0








I created javascript tool that reads a photo from an input field, modifies it, resizes it and displays it on the page in an tag. Then I create a link and start the download automatically.

Everything works perfectly with Firefox, Opera, Safari, but work ONLY ONE TIME in Chrome! (not working all in IE,but is not a problem for me. Any idea?



https://jsfiddle.net/tuttoeniente/efod3avh/1/



EDIT:

ONLY ONE TIME, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.



function downloadCanvas() 
if (datoImg !== undefined)
if (!isChrome && !isIE)
//funziona per firefox, safari ed opera
var link = document.createElement("a");
document.body.appendChild(link);
link.href = datoImg;
link.download = getNomeFoto();
link.dispatchEvent(new MouseEvent('click', bubbles: true, cancelable: true, view: window));
document.body.removeChild(link);
else
//converte in blob, altrimenti chrome non codificava bene
dataURIToBlob(datoImg, callback);

else
alert("Niente da scaricare");




function dataURIToBlob(dataURI, callback)
var binStr = atob(dataURI.split(',')[1]),
len = binStr.length,
arr = new Uint8Array(len);
for (var i = 0; i < len; i++)
arr[i] = binStr.charCodeAt(i);

callback(new Blob([arr]));


//funzione utilizzata per chrome che genera link
var callback = function (blob)
var a = document.createElement('a');
a.download = getNomeFoto();
a.innerHTML = 'download';
a.href = URL.createObjectURL(blob);
a.dispatchEvent(new MouseEvent('click', bubbles: true, cancelable: true, view: window));
;









share|improve this question
















I created javascript tool that reads a photo from an input field, modifies it, resizes it and displays it on the page in an tag. Then I create a link and start the download automatically.

Everything works perfectly with Firefox, Opera, Safari, but work ONLY ONE TIME in Chrome! (not working all in IE,but is not a problem for me. Any idea?



https://jsfiddle.net/tuttoeniente/efod3avh/1/



EDIT:

ONLY ONE TIME, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.



function downloadCanvas() 
if (datoImg !== undefined)
if (!isChrome && !isIE)
//funziona per firefox, safari ed opera
var link = document.createElement("a");
document.body.appendChild(link);
link.href = datoImg;
link.download = getNomeFoto();
link.dispatchEvent(new MouseEvent('click', bubbles: true, cancelable: true, view: window));
document.body.removeChild(link);
else
//converte in blob, altrimenti chrome non codificava bene
dataURIToBlob(datoImg, callback);

else
alert("Niente da scaricare");




function dataURIToBlob(dataURI, callback)
var binStr = atob(dataURI.split(',')[1]),
len = binStr.length,
arr = new Uint8Array(len);
for (var i = 0; i < len; i++)
arr[i] = binStr.charCodeAt(i);

callback(new Blob([arr]));


//funzione utilizzata per chrome che genera link
var callback = function (blob)
var a = document.createElement('a');
a.download = getNomeFoto();
a.innerHTML = 'download';
a.href = URL.createObjectURL(blob);
a.dispatchEvent(new MouseEvent('click', bubbles: true, cancelable: true, view: window));
;






javascript image file canvas blob






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 13:57







Federica

















asked Mar 28 at 11:34









FedericaFederica

12 bronze badges




12 bronze badges















  • Can you explain what "only one time" means? What happens after that? An error? No actions? Something else?

    – Avery
    Mar 28 at 11:36











  • Does it alert Niente da scaricare the second time on chrome?

    – pokeybit
    Mar 28 at 11:37











  • ONLY ONE TIME the link download, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.

    – Federica
    Mar 28 at 11:45












  • The alert serves as a control, I only pasted the part of code inherent to this problem but the app is more complex.

    – Federica
    Mar 28 at 11:45

















  • Can you explain what "only one time" means? What happens after that? An error? No actions? Something else?

    – Avery
    Mar 28 at 11:36











  • Does it alert Niente da scaricare the second time on chrome?

    – pokeybit
    Mar 28 at 11:37











  • ONLY ONE TIME the link download, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.

    – Federica
    Mar 28 at 11:45












  • The alert serves as a control, I only pasted the part of code inherent to this problem but the app is more complex.

    – Federica
    Mar 28 at 11:45
















Can you explain what "only one time" means? What happens after that? An error? No actions? Something else?

– Avery
Mar 28 at 11:36





Can you explain what "only one time" means? What happens after that? An error? No actions? Something else?

– Avery
Mar 28 at 11:36













Does it alert Niente da scaricare the second time on chrome?

– pokeybit
Mar 28 at 11:37





Does it alert Niente da scaricare the second time on chrome?

– pokeybit
Mar 28 at 11:37













ONLY ONE TIME the link download, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.

– Federica
Mar 28 at 11:45






ONLY ONE TIME the link download, I mean after opening the browser. If I close the browser, open it again, the cache will work. Everything works fine, the second time the photo is generated correctly, but it is not downloaded automatically.

– Federica
Mar 28 at 11:45














The alert serves as a control, I only pasted the part of code inherent to this problem but the app is more complex.

– Federica
Mar 28 at 11:45





The alert serves as a control, I only pasted the part of code inherent to this problem but the app is more complex.

– Federica
Mar 28 at 11:45












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55396593%2flink-creation-and-canvas-download-image-work-only-one-time-in-chrome%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55396593%2flink-creation-and-canvas-download-image-work-only-one-time-in-chrome%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript