This GoFr example demonstrates the use of context Bind where incoming request has multipart-form data and then binds
it to the fields of the struct. GoFr currently supports zip file type and also binds the more generic multipart.FileHeader
Usage
type Data struct {
Compressed file.Zip `file:"upload"`
FileHeader *multipart.FileHeader `file:"file_upload"`
}
func Handler (c *gofr.Context) (interface{}, error) {
var d Data
// bind the multipart data into the variable d
err := c.Bind(&d)
if err != nil {
return nil, err
}
}