-
Notifications
You must be signed in to change notification settings - Fork 196
Override upload file max size in mb #2370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
0769b61
6706b67
7c43ce8
02e4da3
f0e0252
a19d1ab
8189209
574a34c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| import { getConfig } from '@edx/frontend-platform'; | ||
|
|
||
| export const DATE_FORMAT = 'MM/dd/yyyy'; | ||
| export const TIME_FORMAT = 'HH:mm'; | ||
| export const DATE_TIME_FORMAT = 'YYYY-MM-DDTHH:mm:ss\\Z'; | ||
|
|
@@ -52,7 +54,16 @@ export const DECODED_ROUTES = { | |
| ], | ||
| }; | ||
|
|
||
| export const UPLOAD_FILE_MAX_SIZE = 20 * 1024 * 1024; // 100mb | ||
| // FilesUpload page - Default max size: 20MB else use env override if exists and valid number | ||
| const DEFAULT_UPLOAD_FILE_MAX_SIZE = 20 * 1024 * 1024; // 20 MB | ||
|
|
||
| export const getUploadFileMaxSize = () => { | ||
| const config = getConfig(); | ||
| const overrideMaxFileSizeMB = parseInt(config.OVERRIDE_UPLOAD_FILE_MAX_SIZE_IN_MB, 10); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Putting |
||
| return !Number.isNaN(overrideMaxFileSizeMB) && overrideMaxFileSizeMB > 0 | ||
| ? overrideMaxFileSizeMB * 1024 * 1024 | ||
| : DEFAULT_UPLOAD_FILE_MAX_SIZE; | ||
| }; | ||
|
|
||
| export const COURSE_BLOCK_NAMES = ({ | ||
| chapter: { id: 'chapter', name: 'Section' }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this function should live in utils.tsx and not in constants.js?