I recommend following the steps outlined below, which were developed by Hitsu in the public GitHub repository using a Lambda function. I have tested these steps successfully and have added a few additional ones. You may find it beneficial to try these steps, as they should yield positive results.
reference : https://github.com/Hitsu-360/aws-lambda-sharepoint-to-s3