1
<a href="1.jpg" download="ImageName">download</a>

I have a download links, when user click it, I want browser open window and let user to chose location they wish to save, anyone know how to achieve?

(browser open window like when you use right click save as)

user2178521
  • 833
  • 1
  • 14
  • 26
  • possible duplicate of [How to Use Content-disposition for force a file to download to the hard drive?](http://stackoverflow.com/questions/9195304/how-to-use-content-disposition-for-force-a-file-to-download-to-the-hard-drive) – danguilherme Sep 03 '14 at 18:31
  • I don't think this is what i'm looking for, 'browser open window' means when u right click on links, it open a window let you choose where you want to save, ex desktop – user2178521 Sep 03 '14 at 18:43
  • With the `Content-Disposition` header set as instructed, the browser will have to download the file, opening a dialog asking the user where to save it. You should notice that this dialog is configurable, as user may have set the files to always be downloaded to a specific folder. – danguilherme Sep 03 '14 at 18:52

1 Answers1

1

You need to set the Content-Disposition response header to force the browser to download the file:

Content-Disposition: attachment; filename="<file name.ext>"

More info: https://stackoverflow.com/a/9195376/1574059

Community
  • 1
  • 1
danguilherme
  • 642
  • 8
  • 23