request entity too large, limit is 1048576, but got 63722000, rejected with code 413
使用FormFile上传文件时,go-zero上传不了超过1mb大小,而用gin可以上传,折腾半天。
```go
RestConf struct {
service.ServiceConf
Host string `json:",default=0.0.0.0"`
Port int
CertFile string `json:",optional"`
KeyFile string `json:",optional"`
Verbose bool `json:",optional"`
MaxConns int `json:",default=10000"`
MaxBytes int64 `json:",default=1048576"`
// milliseconds
Timeout int64 `json:",default=3000"`
CpuThreshold int64 `json:",default=900,range=[0:1000]"`
Signature SignatureConf `json:",optional"`
Middlewares MiddlewaresConf
}
etc下的配置文件改以下参数解决问题。
MaxBytes: 5368709120