From dedc21462fc073c3145b8d0be2bfb2308019892a Mon Sep 17 00:00:00 2001 From: Alexeyzem Date: Wed, 18 Dec 2024 20:00:26 +0300 Subject: [PATCH] fix file size --- internal/fileService/controller/controller.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/fileService/controller/controller.go b/internal/fileService/controller/controller.go index f74be87..45ca2ed 100644 --- a/internal/fileService/controller/controller.go +++ b/internal/fileService/controller/controller.go @@ -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} @@ -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