Skip to content

feat: make max file size configurable via asset upload settings - #38

Open
andrey-canon wants to merge 1 commit into
and/FUTUREX-1503from
and/FUTUREX-1725
Open

andrey-canon wants to merge 1 commit into
and/FUTUREX-1503from
and/FUTUREX-1725

Conversation

@andrey-canon

Copy link
Copy Markdown

Description

This PR makes the maximum file size for asset uploads configurable through the application configuration.

Previously, the limit was hardcoded to a fixed value. Now, the system attempts to fetch MAX_ASSET_UPLOAD_FILE_SIZE_IN_MB from the configuration. If this value is not defined or the API call fails, it gracefully falls back to the constant UPLOAD_FILE_MAX_SIZE.

Issue # 1725
Migration pr of #28

Changes

  • Replaced hardcoded maxFileSize constant with a dynamic configuration lookup.
  • Added a fallback mechanism to ensure uploads continue to work even if the configuration is missing.
  • Converted the configuration value (MB) to bytes for internal validation logic.

Screenshots

Before

  • Hardcoded value: 20 * 1048576 (Fixed 20MB).
image

After

  • Dynamic value: getConfig().MAX_ASSET_UPLOAD_FILE_SIZE_IN_MB with fallback to UPLOAD_FILE_MAX_SIZE.
image

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant