Skip to content

Commit

Permalink
ctx: fix form file not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
acoshift committed May 20, 2018
1 parent 89e5305 commit 56af874
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ func (ctx *appContext) FormFile(key string) (multipart.File, *multipart.FileHead

func (ctx *appContext) FormFileNotEmpty(key string) (multipart.File, *multipart.FileHeader, error) {
file, header, err := ctx.r.FormFile(key)
if err != nil {
return nil, nil, err
}
if header.Size == 0 {
return nil, nil, http.ErrMissingFile
}
Expand Down

0 comments on commit 56af874

Please sign in to comment.