Skip to content Skip to sidebar Skip to footer

How To Forcefully Open The File Browser To Save The File Before Downloading?

I want my chrome browser to forcefully open dialog box for download(i.e Save As). Without manually changing the settings for Downloads in chrome browser. Is there a way doing it us

Solution 1:

Welcome to SO!

There is no way to do what you're suggesting for security reasons. You don't have rights to choose where the file will go on their OS. JS won't go any deeper than the user's browser. What your asking for is essentially FS (file system) read-write permissions.

Make sure to do a little searching around before you ask new questions, as this one was already answered here: Directory Chooser in HTML page


Solution 2:

If I understand your question correctly, then perhaps you are looking for the download attribute on the <a> tag. Note that it is an HTML5 feature and may not be supported by old browsers and that its behavior can be overridden by Content-disposition header in the HTTP response which the server sends.

If you have control of the server, then adding Content-Disposition: attachment; filename="fname.ext" headers to the response can also lead to the browser prompting the user to download the file.


Post a Comment for "How To Forcefully Open The File Browser To Save The File Before Downloading?"