Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: File size exceeds allowed limit of 0 MiB (#1664)

Lincoln Nogueira668a9e88c63b
diff --git a/server/resource.go b/server/resource.go
index 6e7de32cc..f471bc1c9 100644
--- a/server/resource.go
+++ b/server/resource.go
@@ -70,7 +70,8 @@ func (s *Server) registerResourceRoutes(g *echo.Group) {
return echo.NewHTTPError(http.StatusUnauthorized, "Missing user in session")
}
- maxUploadSetting := s.Store.GetSystemSettingValueOrDefault(&ctx, api.SystemSettingMaxUploadSizeMiBName, "0")
+ // This is the backend default max upload size limit.
+ maxUploadSetting := s.Store.GetSystemSettingValueOrDefault(&ctx, api.SystemSettingMaxUploadSizeMiBName, "32")
var settingMaxUploadSizeBytes int
if settingMaxUploadSizeMiB, err := strconv.Atoi(maxUploadSetting); err == nil {
settingMaxUploadSizeBytes = settingMaxUploadSizeMiB * MebiByte
diff --git a/server/system.go b/server/system.go
index 7b865ef28..c98d2bd2d 100644
--- a/server/system.go
+++ b/server/system.go
@@ -44,7 +44,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
AllowSignUp: false,
IgnoreUpgrade: false,
DisablePublicMemos: false,
- MaxUploadSizeMiB: 32,
+ MaxUploadSizeMiB: 32, // this is the frontend default value
AdditionalStyle: "",
AdditionalScript: "",
CustomizedProfile: api.CustomizedProfile{