Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
formFile 関数は完全に機能しますが、ドキュメントでは「FormFile は指定されたフォーム キーの最初のファイルを返す」と述べています。次のような入力を持つhtmlフォームのいくつかのファイルを取得する方法はありますか:
<input type="file" name="myfiles" multiple="multiple">
戻るかも?
FormFile は便利な関数です。MultipartForm で探しているファイルを手動で解析して見つけることができます。
req.ParseMultipartForm(32 << 20) // 32MB is the default used by FormFile fhs := req.MultipartForm.File["myfiles"] for _, fh := range fhs { f, err := fh.Open() // f is one of the files }