Standard S3 is $.02/GB, this is $.12/GB so 6x the price. You don't pay data transfer with this solution at least.
Quick alternative:
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <file-to-upload> <s3-bucket-name>"
exit 1
fi
FILE_TO_UPLOAD=$1
S3_BUCKET=$2
S3_OBJECT_NAME=$(basename "$FILE_TO_UPLOAD")
aws s3 cp "$FILE_TO_UPLOAD" "s3://$S3_BUCKET/$S3_OBJECT_NAME" --acl public-read
if [ $? -eq 0 ]; then
echo "File uploaded successfully."
PUBLIC_URL="https://$S3_BUCKET.s3.amazonaws.com/$S3_OBJECT_NAME"
echo "The file is publicly accessible at: $PUBLIC_URL"
else
echo "Failed to upload file."
exit 1
fi