How to make client open save file dialog when downloading a file
问题 I want the browser to show or open a file save dialog box to save the file I send when user clicks on the download file button. My server side code for download: func Download(w http.ResponseWriter, r *http.Request) { url := "http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png" timeout := time.Duration(5) * time.Second transport := &http.Transport{ ResponseHeaderTimeout: timeout, Dial: func(network, addr string) (net.Conn, error) { return net.DialTimeout(network, addr, timeout) },