I have a function that handles a POST, which uploads a data file.
This is part of the function:
func upload(w http.ResponseWriter, r *http.Request) {
f, _, e := r.FormFile("data")
fmt.Fprintf(w, "%c", 0xfeff)
// more code
}
This works fine.
But then I change it into this:
func upload(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "%c", 0xfeff)
f, _, e := r.FormFile("data")
// more code
}
Now I get an error if I run the code:
multipart: NextPart: http: invalid Read on closed request Body
What is going on here?
--
Peter Kleiweg
http://pkleiweg.home.xs4all.nl/