andersundsehr / aus_driver_amazon_s3

Provides a TYPO3 FAL driver for the Amazon Web Service S3
GNU Lesser General Public License v3.0
20 stars 39 forks source link

Out of memory error when uploading large files #61

Closed kellerrennkadse closed 4 years ago

kellerrennkadse commented 5 years ago

When uploading files that are larger than the php memory limit, the extension triggers an out of memory error, due to this line:

https://github.com/andersundsehr/aus_driver_amazon_s3/blob/master/Classes/Driver/AmazonS3Driver.php#L383

file_get_contents loads the full file into memory, hence exceeding the memory limit.

An alternative would be using the Multipart Uploader integrated into the AWS PHP SDK https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-multipart-upload.html

Lagerregal commented 4 years ago

Thanks for this request! It's solved with the latest version https://github.com/andersundsehr/aus_driver_amazon_s3/commit/7ab21e24d78df524ce4f7b2291f0858984353594