MCPcopy
hub / github.com/gin-gonic/gin / FormFile

Method FormFile

context.go:698–710  ·  context.go::Context.FormFile

FormFile returns the first file for the provided form key.

(name string)

Source from the content-addressed store, hash-verified

696
697// FormFile returns the first file for the provided form key.
698func (c *Context) FormFile(name string) (*multipart.FileHeader, error) {
699 if c.Request.MultipartForm == nil {
700 if err := c.Request.ParseMultipartForm(c.engine.MaxMultipartMemory); err != nil {
701 return nil, err
702 }
703 }
704 f, fh, err := c.Request.FormFile(name)
705 if err != nil {
706 return nil, err
707 }
708 f.Close()
709 return fh, err
710}
711
712// MultipartForm is the parsed multipart form, including file uploads.
713func (c *Context) MultipartForm() (*multipart.Form, error) {

Calls 1

CloseMethod · 0.80