Is it possible to have regular anchor tags pointing to files that open a dialog box for saving a file? Like in a web browser.
For instance:
<a download href="documents/somefile.pdf">Download</a>
And having this anchor tag that launches the Save File dialog when clicked?
I tried using file://absolute-path-to-the-dir/documents/somefile.pdf , and he wants to open the file in the application, and not download it.
Update: In a later version of Electron than I used when I wrote this question, the behavior is the way I want, a window will open that asks the user to save the file.
However, in the case of external links and in order to save the Electron window only for internal links and open external ones in the default OS selection, Joshua Smith's answer can do just that.
source share