1

There is a basic difference between browsers on Windows and Linux( Ubuntu 22.04 ) operating systems.

Default behavior on Windows (clean installation) is that files are automatically downloaded in Download folder.

Default behavior on Linux ( clean installation ) is that Save As dialog is raised. Default Ubuntu 22.04 Save As Chrome

Yes I'm aware that you can configure your browser and enable the feature on Windows operating system. But from UX perspective that is one step too many.

Is there a way to programmatically raise the Save As dialog. For instance this is a snippet that generates a link with few of the options tested:

download(url, downloadName) {
    const a = document.createElement('a');
    a.href = url;
    a.style.display = 'none';
    // a.download = '';
    a.download = downloadName;
    a.target = '_blank';
    a.type = 'application/unknown';
    document.body.appendChild(a);
    a.click();
    document.body.removeChild(a);
    window.URL.revokeObjectURL(url);
  }

Best regards

HMarx
  • 31
  • 2
  • 6

0 Answers0