Skip to content

Commit

Permalink
fix file size
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexeyzem committed Dec 18, 2024
1 parent 733ce44 commit dedc214
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/fileService/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ var fileFormat = map[string]struct{}{
}

const (
charset = "charset=utf"
txt = "txt"
plain = "plain"
charset = "charset=utf"
txt = "txt"
plain = "plain"
maxMemory = 10 * 1024 * 1024
)

//go:generate mockgen -destination=mock.go -source=$GOFILE -package=${GOPACKAGE}
Expand Down Expand Up @@ -136,7 +137,7 @@ func (fc *FileController) Download(w http.ResponseWriter, r *http.Request) {
fc.responder.LogError(my_err.ErrInvalidContext, "")
}

err := r.ParseMultipartForm(100 * (1 << 23)) // 100Mbyte
err := r.ParseMultipartForm(maxMemory) // 100Mbyte
if err != nil {
fc.responder.ErrorBadRequest(w, my_err.ErrToLargeFile, reqID)
return
Expand Down

0 comments on commit dedc214

Please sign in to comment.