#95419 Fileadmin upload larger than php memory limit results in excaused memory limit fatal error (e.g. a 2 GB Video File Upload)
Description
Reproducing
1. Set PHP Memory Limit to e.g. 64 MB
2. Go to TYPO3 Backend -> Fileadmin
3. Upload a test file with a size of 2 GB (e.g. create it on MAC via `dd if=/dev/zero of=100m bs=1m count=2000` or use a video file) to a random existing fileadmin folder
4. The upload startet
5. After 100% upload status the upload throws an “internal server error” error (red loading bar with error text in it)
6. in PHP error log the resulting error is: `Allowed memory size of xyz bytes exhausted`
*Not yed tested in:
TYPO3 > v. 8.7 ELTS
*Explanation*
The reason for that is, that FilePersistenceSlot of sysext:form loads the whole content of the file via file_get_contents into a variable to create a checksum over the including content (getContentSignature() + searchAllowedInvocation()).
*Suggested Patch (works in TPYO3 v8.7 ELTS, not tested yet in TYPO3 v10/11/12)*
- See attached patch file
- The patch limits the content size for checksum creation, so that max 32 MB of file content is used for checksum creation.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
Files 1
History 5
-
Matthias Gläßner changed category 09/30/21, 16:24
-
Matthias Gläßner changed target version 09/30/21, 16:31
-
Georg Ringer commented and changed Sprint Focus Needs Decision 06/23/24, 20:40
-
Georg Ringer changed Related to #88235 06/27/24, 12:54
-
Georg Ringer commented and changed status
NewClosed 06/27/24, 13:24I am closing this issue as this has been solved with #88235 which means that it would only occur if a .form.yaml file got a larger size than the memory which should really never be the case
patch would still apply, but do we really have this issue?