-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[6.1] Media: fix large file upload by using of binary upload instead of base64, and display correct upload progress #44848
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
base: 6.1-dev
Are you sure you want to change the base?
Conversation
administrator/components/com_media/resources/scripts/store/mutation-types.es6.js
Outdated
Show resolved
Hide resolved
…ation-types.es6.js Co-authored-by: Brian Teeman <[email protected]>
I like that change, but this will break 3rd party extensions when the data can be all of the sudden a resource. I would read the file content it in the api controller and then pass it to the adapter the same way as before that no changes are needed in the adapter. Additionally, the check content logic can probably be moved to the, but not sure about this. |
@laoneo Moved to the ... what? |
ApiController |
Hmhm,
No no, this not going to work, you will get "out of memory" error when try to read 100Mb file when PHP limit is 60Mb. What about stringable object? |
Not sure if stringable would solve it. But I think the main goal should be to do it in a bc way. |
I updated the code to use stringable object. Would be good to have some more test, to be sure, with 3rd filesystem adapters. |
I have not tested this item. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44848. |
I have not tested this item. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44848. |
Conflicts: plugins/filesystem/local/src/Adapter/LocalAdapter.php
This pull request has been automatically rebased to 6.0-dev. |
This pull request has been automatically rebased to 6.1-dev. |
Summary of Changes
The PR changes the media manager to use FormData for file upload, instead of base64 payload.
Which improves responsiveness, performance and handling of large files in general.
However the api/ calls still uses base64 because it is hard to do in b/c maner.
Bonus: the upload progres now showing actual upload progress.
Testing Instructions
Apply patch.
Run
npm install
.Go to media manager and try upload something bigger than 100Mb
Addittionaly, test with any 3d filesystem plugin.
Actual result BEFORE applying this Pull Request
The browser hangs for a while, and dependent from your luck the upload will be completed after some waiting.
Expected result AFTER applying this Pull Request
The upload starts immediately, and you can see progress (a litle 5px blue line over the files list)
Link to documentations
Please select: