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

Written by
Link to Post

https://www.reddit.com/r/golang/comments/adjqmh/how_to_save_form_data_and_upload_file_in_a_single/

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.

No?

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

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

Article Tags:
· ·
Article Categories:
reddit

Leave a Reply