Hi Andrew,
Sorry about the repeated posts and deletes - I'm trying to figure out how to use this interface.
Thank you for your suggestion and help. Your suggestion REALLY helped but it took me the intervening time to figure out how to get/install/configure/implement it.
So the Lucee-AWS documentation was of limited use but then I'm not an expert on image processing or handling. To potentially save others my pain here's some instructions and sample code:
1. Get the Lucee-AWS extension installed on your box however you can. There's limited help at
https://github.com/mso-net/lucee-aws. I installed and used the recommended CommandBox tool but figuring out how to install CommandBox on my remote Linux server was a bit if a puzzle to me in itself.
2. Once Lucee-AWS is installed then you can put it to use - And it's pretty simple to use once installed BUT only if you know that you need to use the binary read and base64 conversions.
3. You add this to your Application.cfc file:
this.javaSettings = { loadPaths: [ '/aws/aws-java-sdk/']};
4. Here's sample code how to USE the extension in a CFM template.
<cfscript>
// Setup to use the method calls
s3 = new aws.s3(
account = '#awsAccessKeyId#',
secret = '#awsSecretKey#',
bucket = 'myBucket'
);
// To read an image from S3
myObj = s3.getObject( 'myImage.jpg' );
myImg = imageReadBase64(myObj.content);
// You can now treat myImg as a ColdFusion image
// To write an image to S3 first read the image file as binary and then convert it to base64
myImg = toBase64(fileReadBinary('mytest.jpg'));
// This is how you send the file to S3 - Note that you have to insert the "data:image/jpg;base64," in front of the image base64 string.
// Change the file extension as needed but I'm pretty sure it has to match the extension of the file you read in, perhaps not
s3.putObject( 'myFolder/myImage.jpg' , 'data:image/jpg;base64,#myImg#' );
// Delete an image object from S3
s3.deleteObject( 'myFolder/myImage.jpg' );
</cfscript>
Mike