diff options
Diffstat (limited to 'api/file.go')
-rw-r--r-- | api/file.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/api/file.go b/api/file.go index 8afc70692..4339e610b 100644 --- a/api/file.go +++ b/api/file.go @@ -76,6 +76,12 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) { return } + if r.ContentLength > model.MAX_FILE_SIZE { + c.Err = model.NewAppError("uploadFile", "Unable to upload file. File is too large.", "") + c.Err.StatusCode = http.StatusRequestEntityTooLarge + return + } + err := r.ParseMultipartForm(model.MAX_FILE_SIZE) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) |