How to put file to Amazon S3

Hi all,
I’m a newbie in legato.
I am using WP7607, I would like to build an application to put file to Amazon S3.
Do anyone have the sample app?

I tried with simple app to execute test.sh as below:
COMPONENT_INIT
{
system("/tmp/test.sh");
LE_INFO(“Put file to S3”);
}

test.sh:
‘’’
file=/tmp/upload.tar.gz
bucket=your-bucket
resource="/{bucket}/{file}"
contentType=“application/x-compressed-tar”
dateValue=date -R
stringToSign=“PUT\n\n${contentType}\n${dateValue}\n${resource}”
s3Key=xxxxxxxxxxxxxxxxxxxx
s3Secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
signature=echo -en {stringToSign} | openssl sha1 -hmac {s3Secret} -binary | base64
curl -X PUT -T “{file}" \ -H "Host: {bucket}.s3.amazonaws.com”
-H “Date: {dateValue}" \ -H "Content-Type: {contentType}”
-H “Authorization: AWS {s3Key}:{signature}”
https://{bucket}.s3.amazonaws.com/{file}
‘’’
But the device informed that “-sh: base64: not found”. Do you know how to fix it? Any help would be greatly appreciated.

Thanks,

Here says you will need to compile base64 from the gnu coreutils as that isn’t included in the image.

Or you can use attached busybox for base64:
root@swi-mdm9x28-wp:~# chmod 777 /home/root/busybox-armv5l_1.26
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# echo “testest” | /home/root/busybox-armv5l_1.26 base64
dGVzdGVzdAo=

busybox-armv5l_1.26 (1.1 MB)

Thank jyijyi,
I have tried and no success. It looks like that the script is too old and Amazon had changed the authentication mechanism.
InvalidRequestThe authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

If no one has the updated scripts, I will find the script in other forums.

Thanks,