Handling uploaded files in Go is quite easy. Here is a complete example.
- net/http.Request.ParseMultipartForm parses a request body as multipart/form-data. You can get files with
net/http.Request.FormFile
after calling the method - net/http.Request.FormFile returns mime/multipart.File and mime/multipart.FileHeader.
- You can read a content from mime/multipart.File
- You can get a file name from mime/multipart.FileHeader
The Go Programming Language (Addison-Wesley Professional Computing Series)
- 作者: Alan A. A. Donovan,Brian W. Kernighan
- 出版社/メーカー: Addison-Wesley Professional
- 発売日: 2015/11/16
- メディア: Kindle版
- この商品を含むブログを見る