How to upload a folder content to AWS S3 in PHP?

From machine learning to a lambda function, most of the projects running on AWS relies on an S3 bucket to store the files you need for other AWS services.

Uploading using the AWS S3 bucket web interface can be impossible when the folder contents contain thousands of files. (or if this folder is only available on an Apache server running PHP)

Running a small PHP script is then a great way to simplify the process. You’ll just need the following prerequisites :

Once this is done, you’ll need to adapt the following PHP script for your use case and0/d run it with :

php -f YOUR_SCRIPT_FILE_NAME.php

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top