File Upload Failures Due to Excessive Chunk Upload Size and PHP Memory Limit
Original Question or Issue:
Users were unable to upload large files through the FileCloud User Portal. Upload attempts failed with an HTTP 500 Internal Server Error.
The issue occurred when uploading a 2.69 GB file using S3-compatible storage.
Environment:
- Product - FileCloud Server
- Version - 23.263.2
- Platform - Windows, Linux
Steps to Reproduce:
Error or Log Message:
HTTP 500 Internal Server Error during file upload.
No specific PHP error message was provided.
Defect or Enhancement Number:
Cause:
Starting with FileCloud Server 23.263.0, the backend automatically limits the chunk size advertised to the browser based on the PHP post_max_size configuration.
In the affected environment, the configuration was:
|
Parameter |
Configured Value |
|---|---|
|
Chunk Upload Size |
500,000 MB |
|
PHP |
500 MB |
|
PHP |
500 MB |
|
Actual chunk size sent by browser |
499 MB |
With the S3 upload method, the backend loads each received chunk entirely into memory before forwarding it to MinIO.
Processing a 499 MB chunk requires approximately 523 MB of memory, exceeding the configured PHP memory limit of 500 MB.
Consequently, PHP runs out of available memory, resulting in an HTTP 500 error and failed uploads.
Resolution or Workaround:
Reduce the Chunk Upload Size to the default recommended value of 40 MB.
Steps:
- Log in to the FileCloud Admin Portal.
- Navigate to Settings → Storage.
- Locate Chunk Upload Size.
- Change the value from 500,000 MB to 40 MB.
- Save the changes.
- Reload the FileCloud browser page.
- Retry uploading the previously failing file.
Notes:
If the environment requires larger upload chunks, Development recommends configuring the Chunk Upload Size to no more than approximately half of the PHP memory_limit.
For example, with a PHP memory_limit of 500 MB, the recommended maximum chunk size would be approximately 250 MB.