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: uploadButton data-max-filesize attribute is not passed to file-uploader #1503

Conversation

fabien-michel
Copy link
Contributor

@fabien-michel fabien-michel commented Oct 16, 2024

The attribute exists on the upload button, but it is not read and used.

This PR fix upload-button.js to read the value tranform from MiB to bytes and pass the param to FileUploaderBasic object.

By the way, the library used is more than 10 years old of age (2011 ?) and is not even maintained since 2018 (repo archived)
Also it is strange to have 2 distinct upload mechanisms, one for dropzone and one for upload button.

  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

@fsbraun
Copy link
Member

fsbraun commented Oct 16, 2024

@fabien-michel Did you test this?

@fabien-michel
Copy link
Contributor Author

Yes but maybe I miss something. What do you mean ?

@fsbraun
Copy link
Member

fsbraun commented Oct 16, 2024

I just wanted to verify that with the previous PR this actually makes the upload limit work.

@fabien-michel
Copy link
Contributor Author

fabien-michel commented Oct 16, 2024

Ok sorry I understand I should have give more informations.

In order to understand how to set up the uploader, I've found the uncompressed file uploader JS file here : https://github.com/FineUploader/fine-uploader/blob/83e14f51b2421b80c14cd0c28668171a6777a154/client/fileuploader.js#L272

The file uploader display a popup when file exceed the max. (weirdly displayed in GiB)

Example for a limit to 100MiB (FILER_UPLOADER_MAX_FILE_SIZE=100)
2024-10-16_18-31-28

@fsbraun fsbraun merged commit d72520c into django-cms:master Oct 16, 2024
34 checks passed
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.

2 participants