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

Unit conversion mismatch in maximum upload file sizes #5418

Open
moschlar opened this issue Mar 29, 2023 · 0 comments
Open

Unit conversion mismatch in maximum upload file sizes #5418

moschlar opened this issue Mar 29, 2023 · 0 comments

Comments

@moschlar
Copy link
Contributor

The interpretation of the variables max_upload_size|max_upload_file_size|max_upload_size_mb|maxUploadFileSize|maxFileSize throughout the Seafile code base is not unified - in some places, it is used as a binary size unit, in others as a decimal size unit, leading to the effect that the size shown on the upload link page is slightly larger than what is actually accepted:

seafile/lib/python3/site-packages/seaserv/service.py
70:    max_upload_size_mb = int(get_fileserver_option('max_upload_size', 0))
71:    if max_upload_size_mb > 0:
72:        MAX_UPLOAD_FILE_SIZE = max_upload_size_mb * (2 ** 20)

vs.

seahub/frontend/src/components/shared-link-file-uploader/file-uploader.js
7:import { resumableUploadFileBlockSize, maxUploadFileSize, maxNumberOfFilesForFileupload } from '../../utils/constants';
67:      maxFileSize: maxUploadFileSize * 1000 * 1000 || undefined,
118:    if (this.maxFileSizeErrorCallback) {
119:      this.resumable.opts.maxFileSizeErrorCallback = this.maxFileSizeErrorCallback;
152:  maxFileSizeErrorCallback = (file) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants