Skip to content
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

fix: [AXIMST-510] there is no message if a user upload a large file #183

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

@@ -57,4 +57,4 @@ export const COURSE_BLOCK_NAMES = /** @type {const} */ ({
component: { id: 'component', name: 'Component' },
});

export const UPLOAD_FILE_MAX_SIZE = 100 * 1024 * 1024; // 100mb
export const UPLOAD_FILE_MAX_SIZE = 20 * 1000 * 1000; // 20mb
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I have a file with such size as shown on the picture it will 20312736.
image
In that time if I set 20 * 1024 * 1024 it results in 20971520. This means that 20312736 is valid size. But when I upload to the server I receive 413 error that means the file is too large.

The solution is to set 20 * 1000 * 1000 that works good for both backend and frontend.

@monteri monteri force-pushed the zadorozhnii/max-file-size-issue branch from be93e22 to f8ec3b0 Compare February 23, 2024 14:57
@monteri monteri force-pushed the zadorozhnii/max-file-size-issue branch from f8ec3b0 to deca896 Compare February 23, 2024 15:03
src/generic/modal-dropzone/messages.js Show resolved Hide resolved
} finally {
setDisabledUploadBtn(true);
setUploadProgress(0);
setPreviewUrl(null);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill take this approach with finally into account:)

@@ -43,6 +44,11 @@ const ModalDropzone = ({
onChange, onCancel, onClose, fileTypes, onSavingStatus,
});

const invalidSizeMore = intl.formatMessage(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit]

Suggested change
const invalidSizeMore = intl.formatMessage(
const invalidSizeMoreMsg = intl.formatMessage(

@monteri monteri merged commit 68d7533 into ts-develop Feb 23, 2024
3 checks passed
ihor-romaniuk pushed a commit that referenced this pull request Feb 29, 2024
…183)

* fix: [AXIMST-510] there is no message if a user upload a large file

* fix: after review

* fix: add translations

---------

Co-authored-by: monteri <lansevermore>
ihor-romaniuk pushed a commit that referenced this pull request Feb 29, 2024
…183)

* fix: [AXIMST-510] there is no message if a user upload a large file

* fix: after review

* fix: add translations

---------

Co-authored-by: monteri <lansevermore>
khudym pushed a commit that referenced this pull request Mar 25, 2024
…183)

* fix: [AXIMST-510] there is no message if a user upload a large file

* fix: after review

* fix: add translations

---------

Co-authored-by: monteri <lansevermore>
monteri added a commit that referenced this pull request Apr 1, 2024
…183)

* fix: [AXIMST-510] there is no message if a user upload a large file

* fix: after review

* fix: add translations

---------

Co-authored-by: monteri <lansevermore>
monteri pushed a commit that referenced this pull request Apr 29, 2024
…183)

* fix: [AXIMST-510] there is no message if a user upload a large file

* fix: after review

* fix: add translations

---------

Co-authored-by: monteri <lansevermore>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants