How to save form data and upload file in a single request/handler?

Written by
Link to Post

I know how to handle form data. And I already know to upload a file.

Is it possible to do both in a single handler on a server? That is, I’d have a form with a input type=”file” and several textboxes. And I’d want to save both — file and form data – in a single request handler.

My concertn is that, once `ParseMultipartForm`, the text data from my form will get lost or parsed inproperly, because that’s text data, whereas a file is binary data.


For “net/http” + “gorilla/mux”

submitted by /u/kazzaru
[link] [comments]

Article Tags:
· ·
Article Categories:

Leave a Reply