简体   繁体   中英

Download links click browser open download window

<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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM