1

In my web application there is a download button, when user clicks on it a file gets downloaded to the "Downloads" folder. I want to add an option where user can select the folder in which the file should be downloaded.

enter image description here

How can I do this? Is there any plugin available for this?

Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133
  • 5
    File download destination is controlled by the browser. As a user, I don't want your site to be able to put any files in my Application Data/cookies/Windows folders. – DCoder Mar 11 '13 at 07:42
  • in simple you cant.!!. for the security purpose you can't change the locaton of the download folder. – Ravi Gadag Mar 11 '13 at 07:42

1 Answers1

1

You will not be able to choose the user's download location with javascript or jquery. This can only be set from the user's end, It contains on the browser. otherwise it would violate user's security. What you can suggest is the file's name. Read more

Community
  • 1
  • 1
Techie
  • 44,706
  • 42
  • 157
  • 243
  • 4
    Yes but how can we trigger the "save as" menu in Javascript ? That way the user will be able to select the folder to save. – user666 Sep 22 '15 at 09:23
  • For you and others who are searching for an answer, maybe this will be helpful: https://stackoverflow.com/questions/27525256/prompt-a-download-location-instead-of-downloading-directly – AlirezaAsadi Nov 12 '20 at 09:51
  • To trigger a "Save As" dialog you'll have to use the **File System Access API** which is not supported by all browsers. Read here for further information https://stackoverflow.com/a/70001920/9064287 – nhaggen Apr 01 '22 at 08:24