Secure S3 URL generation for file uploads.
Blob Uploader is an HTTP Rest API for generating unique S3 URLS. The BlinkMobile Form Submission service uses Blob Uploader to upload large files to AWS. Files are uploaded to S3 in the background prior to the actual form submission. On form submission, files are moved from S3 to their final storage location.
You can use Blob Uploader when your hosting solution doesn't allow large file uploads (AWS Lambda for example). You will need to deploy and host the service using BlinkMobile's Server CLI.
Once the service is deployed and available at a live URL ("https://YOUR_HOST_NAME" for the example below), you can use it like this:
You will get back a JSON packet with a PUT URL(which will expire after 1 hour) and a id eg:
{
"putUrl": "https://blob1.s3.amazonaws.com/blahblob?AWSAccessKeyId=AKIAIDAL6KPDH3MZAD3Q&Expires=1496814897&Signature=dOfxf9LtO7kBa6n05h0%2Bt8RCtK0%3D",
"id": "003d96d4-31a8-4740-8b3a-5106aadf9b6d"
}
OR
You will get back a JSON packet with temporary AWS credentials for uploading to S3 for the specified region, bucket and key, eg:
{
"credentials": {
"AccessKeyId": "",
"SecretAccessKey": "",
"SessionToken": "",
"Expiration": ""
},
"bucket": "",
"id": "",
"region": ""
}
You will get back a JSON packet with a GET url:
{
"getUrl": "https://blob1.s3.amazonaws.com/blahblob?AWSAccessKeyId=AKIAIDAL6KPDH3MZAD3Q&Expires=1496814897&Signature=dOfxf9LtO7kBa6n05h0%2Bt8RCtK0%3D"
}