How to make browser display open / save dialog using jquery?

How to make browser display open / save dialog using jquery?

+4
source share
2 answers

Impossible. Browsers handle this specifically so that hackers cannot force you to download the virus, which would be much easier for them if this happened in javascript.

+3
source

What I did in situations like open opened an invisible iFrame on the page using javascript, which opens the page with the corresponding HTTP headers:

Content-Disposition: attachment; filename=genome.jpeg;

Naturally change "genome.jpg" to the corresponding default file name.

+1
source

Source: https://habr.com/ru/post/1307111/


All Articles