jcberquist/aws-cfml

How to put a file to Wasabi S3?

Closed this issue · 5 comments

I am trying to put a file to s3.wasabisys.com instead of amazon. Their compatibility with Amazon is 100%.

Where is the code below can i specify the different end-point?

aws = new aws(
    awsKey = 'YOUR_PUBLIC_KEY',
    awsSecretKey = 'YOUR_PRIVATE_KEY',
    defaultRegion = 'us-east-1'
);

zipFileData = fileReadBinary('myfile.zip');
aws.s3.putObject(bucket = 'mybucket', objectKey = 'xxxx', fileContent = zipFileData);

Hi, you should be able to do this by using the constructorArgs with a host setting for s3:

aws = new aws(
    awsKey = 'YOUR_PUBLIC_KEY',
    awsSecretKey = 'YOUR_PRIVATE_KEY',
    defaultRegion = 'us-east-1',
    constructorArgs = {
        s3: {
            host: 's3.wasabisys.com'
        }
    }
);

@jcberquist perfect! Thank you Sir!

@jcberquist sorry to bother ... is there any way to create folders within buckets? If yes, what would the code for that look like?

Have you looked at this? https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-folders.html - basically there aren't really any folders on AWS S3 (or an equivalent service) - but you can try putting a zero length object with a key name ending in / to emulate a folder.