You get the desired effect (the web page showing the link, and when the user clicks the button, the save dialog opens) when the corresponding response headers are present, when the browser requests the resource:
Content-Disposition: attachment; file name = "yourfilename.extension"
If you get the file from the server as a base64 string embedded in your html, perhaps you can skip the attachment and simply insert a direct link to the file on your server, having a server serving it for the user.
Related SOs on Content-Disposition
Kirk B.
source share