You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code:
file, err := os.Open("helloWorld.wav")
buf := new(bytes.Buffer)
writer := multipart.NewWriter(buf)
audioFile, _ := writer.CreateFormFile("file", "helloWorld.wav")
_, err = io.Copy(audioFile, file)
if err != nil {
return nil, 0, err
}
writer.Close()
Produces a Content-Type of 'application/octet-stream' when it creates the field. There
are cases where you want to set the Content-Type to something like 'audio/wav' and other
types. You may do some things by hand like this as a work around:
http://play.golang.org/p/p5U_puIvkg
It would be appropriate to have the multipart library support setting the Content-Type
by individual form field.