Error reporting should be consistent with the scenario. It should not say the file is too large when it isn't bigger than the limits set in mediamanager - if these are lower than php. It should throw the error when the file is too big and not say it is uploaded.
File is too big Error throws in scenerio where file is below the threshold. File uploaded message where the file is too big.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
I'm debugging this issue and found that the Upload function of the Media Manager is using the File: readAsDataURL() method where the file's data is represented as a base64 encoded string.
That means the size of the Base64 version of the file is typically roughly a third larger than its source, refer to Encoded size increase
For example if the file size is 3.5mb (3670016 bytes), the size of its Base64 version will be ~4881121 bytes.
In our case the filesize limit is set to 4mb (4194304 bytes), it is clear enough that the size of the Base64 version is larger than the filesize limit, so the upload is failed and says the file is to large to upload!
I tried multiplying filesize limit by 1.33 before checking the file size and it works:
$paramsUploadMaxsize = $params->get('upload_maxsize', 0) * 1024 * 1024 * 1.33;
but I'm not sure whether this is the best approach to handle it, please let me know your thoughts.
Hi, I have this issue too.
PHP and Media Manager's limits set to 100MB, which workt for files up to ~50 MB.
After that a blue progress line, even a success message, but no file uploaded.
On the other hand, if I upload a file with JCE I can go up to 95 MB as expected.
So it must be a Media Manager issue. On Joomla 4 and 5.
System1: PHP 8.1.29, Joomla 4.4.5
System2: PHP 8.2.20, Joomla 5.1.1
Update: when I set the memory_limit to 384 MB (the highest value that my hoster allows) the max file size that can be uploaded goes up a bit, but never comes even near 100 MB,
Title |
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-08-10 10:16:12 |
Closed_By | ⇒ | richard67 |
The 3.5 issue could be the result of rounding a float to an integer in combination with wrong logic so >= is used instead of > (which would be wrong of course, am just thinking about what could cause that).