0

I am fairly new to HTML and have a file that the end users can download:

<a href="filetodownload.exe" download>Download</a>

This automatically downloads the file to the Downloads directory. However, I would like to have a dialog box that allows user to navigate to the folder of choice and download to that folder instead of the default Downloads directory.

Zach Jensz
  • 3,650
  • 5
  • 15
  • 30
JohnK
  • 1
  • 1

1 Answers1

2

This is not possible currently, the user can change where they want downloads from the internet to happen in their browser settings so websites can't just add files anywhere they want. The reason they are going in your downloads folder is probably because of your browser settings, you made it so that downloads always go to the downloads folder for you, some users don't have that setting selected so they get asked where they want the files to go by the browser. So, unfortunately this is not possible with the current state of html.

  • Can this be done with Java? – JohnK May 20 '22 at 20:02
  • @JohnK No, not that I know of. Any language on the web cannot access user file systems. And if you plan on using Java for web development, I highly suggest you don't since it's not really made for that. It's made for android apps, video games, or desktop apps. – Axazexz player May 20 '22 at 22:35
  • The Opera browser opens a folder chooser automatically whin the Download link is clicked. Are they ignoring a security rule? If Opera can do it, why can't a Java routine be developed to duplicate what Opera does? – JohnK May 21 '22 at 03:32
  • @JohnK Websites can't access user file system so theres no way to display it if you do not have access to it. Opera is a browser **application** and apps can do whatever they want on a users computer once they are downloaded so opera can access your file system easily .Your java program is on the web so it has little to no power on the user but opera does since its on your **computer** . There's also probably a setting in Opera to make downloads automatically go in downloads folder. – Axazexz player May 21 '22 at 04:24
  • I am not planning to use this this for for android apps, video game, etc., just Windows. – JohnK May 21 '22 at 07:55