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,