Skip to content

Commit

Permalink
Merge pull request #33 from acoshift/fix-formfile
Browse files Browse the repository at this point in the history
ctx: fix form file not empty
  • Loading branch information
acoshift committed May 20, 2018
2 parents 89e5305 + 56af874 commit d70e61a
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 d70e61a

Please sign in to comment.