hussain hussain - 2 months ago 5x
Javascript Question

How to prompt save as option for user to download file using chrome?

I have method that is downloading file whenever this method called it is working as expected, I just see difference in browser in IE user has option to save As file but in chrome it directly download the file , How can we have that feature in chrome so user can use Save as option while saving the file so they can name the file ?


function deleteFile(filename){
console.log('data for download', response);
var data = JSON.stringify(;
var blob = new Blob([data], { type: 'text/plain;charset=utf-8' });
FileSaver.saveAs(blob, 'server.log');


What you are asking isn't possible.
It's a user preference

enter image description here


The only thing you can do is letting the user rename server.log inside a input element or a window.prompt before saving

saveAs(blob, prompt('Filename?', 'server.log') || 'server.log');