0

I have written an application where on button click a .docx file is generated on the server and returned to client as base64 string. What I want to do now, is to let the user download the file in a directory of their choice.

To demonstrate what I mean, if I instead want to upload a file having a <input type='file'/> opens a dialog such like this enter image description here

Where I can select the file. Is there any way to open this kind of dialog for a download button? I understand that the web-page doesn't receive the actual path on a clients pc for security reasons, but if you can chose an upload file, there is no reason to not chose a download path right?

Community
  • 1
  • 1
Vahagn Tumanyan
  • 500
  • 1
  • 13
  • 29
  • Possible duplicate of [How to make a browser display a "save as dialog" so the user can save the content of a string to a file on his system?](https://stackoverflow.com/questions/11336663/how-to-make-a-browser-display-a-save-as-dialog-so-the-user-can-save-the-conten) – Harun Yilmaz Sep 12 '19 at 13:07

1 Answers1

0

No, for security reasons this is not possible.

See: https://github.com/eligrey/FileSaver.js/issues/42

skolldev
  • 1,179
  • 9
  • 19