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 :
- Create an IAM user with an Access Key and the role : AmazonS3FullAccess (read how : https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html)
- Download the AWS PHP Sdk to access AWS functionalities in PHP (read more : https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/getting-started_installation.html)
Once this is done, you’ll need to adapt the following PHP script for your use case and0/
php -f YOUR_SCRIPT_FILE_NAME.php