All the examples I find online have a space after attachment; most also 
quote the filename parameter, filename="foo.txt", although the RFC does 
not. Hopefully its something as simple as this.

On Friday, 24 June 2016 07:35:34 UTC+10, David Marceau wrote:
>
> I'm using TLS/http/gorillamux golang web server.
>
> strSomeFileName := "blah.json" //"blah.txt" // "blah.bin"
> w.Header().Set("Content-Type","application/octet-stream") 
> w.Header().Set("Content-Disposition", "attachment;filename=" + 
> strSomeFileName)
> myCmdOutput, _ := cmd.Output()
>
> //with or without following line, it still doesnt display the 
> "file->save..." dialog in the web browser
> //w.Header().Set("Content-Length", strconv.Ito( len(myCmdOutput) ) )
>
> w.Write(myCmdOutput)
>
> Does anyone have any hints as to what I'm missing?
>
> Thank you and cheers.
>
> David Marceau
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to