FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

Amazon S3 SDK

v4.4.0+101 Public

Build Status

Welcome to the Amazon S3, DigitalOcean Spaces SDK

This SDK allows you to add Amazon S3, Digital Ocean Spaces capabilities to your ColdFusion (CFML) applications. It is also a ColdBox Module, so if you are using ColdBox, you get auto-registration and much more.

Resources

  • Source: https://github.com/coldbox-modules/s3sdk
  • Issues: https://github.com/coldbox-modules/s3sdk/issues
  • Changelog
  • S3 API Reference: http://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html
  • Digital Oceans Spaces API Reference: https://developers.digitalocean.com/documentation/spaces/

Installation

This SDK can be installed as standalone or as a ColdBox Module. Either approach requires a simple CommandBox command:

box install s3sdk

Then follow either the standalone or module instructions below.

Standalone

This SDK will be installed into a directory called s3sdk and then the SDK can be instantiated via new s3sdk.models.AmazonS3() with the following constructor arguments:

/**
 * Create a new S3SDK Instance
 *
 * @accessKey The Amazon access key.
 * @secretKey The Amazon secret key.
 * @awsRegion The Amazon region. Defaults to us-east-1
 * @awsDomain The Domain used S3 Service (amazonws.com, digitalocean.com). Defaults to amazonws.com
 * @encryption_charset The charset for the encryption. Defaults to UTF-8.
 * @ssl True if the request should use SSL. Defaults to true.
 * @defaultDelimiter Delimter to use for getBucket calls. "/" is standard to treat keys as file paths
 * @defaultBucketName Bucket name to use by default
 *
 * @return An AmazonS3 instance.
 */
public AmazonS3 function init(
	required string accessKey,
	required string secretKey,
	string awsRegion = "us-east-1",
	string awsDomain = "amazonaws.com",
	string encryption_charset = "UTF-8",
	boolean ssl = true,
	string defaultDelimiter='/',
	string defaultBucketName=''
)

ColdBox Module

This package also is a ColdBox module as well. The module can be configured by creating an s3sdk configuration structure in your moduleSettings struct in the application configuration file: config/Coldbox.cfc with the following settings:

moduleSettings = {
	s3sdk = {
		// Your amazon, digital ocean access key
		accessKey = "",
		// Your amazon, digital ocean secret key
		secretKey = "",
		// The default encryption character set: defaults to utf-8
		encryption_charset = "utf-8",
		// SSL mode or not on cfhttp calls: Defaults to true
		ssl = true,
		// Your AWS/Digital Ocean Region: Defaults to us-east-1
		awsregion = "us-east-1",
		// Your AWS/Digital Ocean Domain Mapping: defaults to amazonaws.com
		awsDomain = "amazonaws.com",
		// The default delimiter for folder operations
		defaultDelimiter	= "/",
		// The default bucket name to root the operations on.
		defaultBucketName	= ""
	}
};

Then you can leverage the SDK CFC via the injection DSL: [email protected]

Usage

Please check out the api docs: https://apidocs.ortussolutions.com/#/coldbox-modules/s3sdk/

Changelog

v4.4.0

  • Reworked SSL setup to allow for dynamic creation of the URL entry point
  • Removed ACF11 officially, it is impossible to deal with their cfhttp junk! It works, but at your own risk.

v4.3.0

  • Removal of debugging code

v4.2.1

  • Avoid double encoding on copy, putObjectFile, and delete() operations
  • Consolidate ssl to use variables instead of arguments

v4.2.0

  • ACF compatiblities
  • Fixes for auth on folder commands
  • New constructor args: defaultDelimiter for folder operations, defaultBucketname so you can set a default bucket for all bucket related operations.
  • Avoid nasty error on bucket deletion
  • Add new method objectExists() boolean check for objects
  • Fix URI encoding on signatures for headers and query params

v4.1.1

  • Left some dump/aborts

v4.1.0

  • DigitalOcean Spaces compatiblity
  • Region naming support, you can now pass the awsRegion argument to the constructor to select the AWS or DO region
  • SSL is now the default for all operations
  • Addition of two new constructor params: awsRegion and awsDomain to support regions and multi-domains for AWS and Digital Ocean
  • Added log debugging to calls and signatures if LogBox is on debug level

v4.0.1

  • Fixes to models location, oopsy!

v4.0.0

  • AWS Region Support
  • Migrated Module Layout to use Ortus Standard Module Layout
  • Added testing for all ACF Engines
  • Rework as generic Box module (compatibility change), you must move your s3sdk top level settings in ColdBox Config to moduleSettings.s3sdk
  • deleteBucket() returns false if bucket doesn't exist instead of throwing an exception
  • Few optimizations and documentation of the API

v3.0.1

  • Travis Updates and self-publishing

v3.0.0

  • Ugprade to ColdBox 4 standards
  • Upgrade to latest Amazon S3 SDK standards
  • Travis build process

v2.0

  • Original Spec as a ColdBox Plugin

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
Current
4.4.0+101 May 15 2019 11:36 AM May 15 2019 11:36 AM
Version History
4.4.0-snapshot Apr 05 2019 11:19 AM Apr 05 2019 11:19 AM
4.3.0+97 Apr 05 2019 11:24 AM Apr 05 2019 11:24 AM
4.3.0-snapshot Mar 14 2019 05:57 PM Mar 14 2019 05:57 PM
4.2.1+93 Mar 26 2019 03:34 PM Mar 26 2019 03:34 PM
4.2.1-snapshot Mar 23 2019 09:35 AM Mar 23 2019 09:35 AM
4.2.0+88 Mar 15 2019 04:45 PM Mar 15 2019 04:45 PM
4.2.0-snapshot Mar 13 2019 04:56 PM Mar 13 2019 04:56 PM
4.1.1+79 Mar 14 2019 03:45 PM Mar 14 2019 03:45 PM
4.1.1-snapshot Mar 14 2019 03:43 PM Mar 14 2019 03:43 PM
4.1.0+75 Mar 13 2019 04:20 PM Mar 13 2019 04:20 PM
4.1.0-snapshot Oct 20 2018 03:56 PM Mar 13 2019 10:43 AM
4.0.1+64 Oct 22 2018 10:08 PM Oct 22 2018 10:08 PM
4.0.1-snapshot Oct 22 2018 09:56 PM Oct 22 2018 09:56 PM
4.0.0+55 Oct 20 2018 03:52 PM Oct 20 2018 03:52 PM
3.0.1+36 Oct 08 2018 08:11 PM Oct 08 2018 08:11 PM
3.0.1+34 Jan 18 2018 09:40 PM Jan 18 2018 09:40 PM
3.0.1+32 Jan 17 2018 09:40 PM Jan 17 2018 09:40 PM
3.0.1+30 Nov 29 2017 09:19 AM Nov 29 2017 09:19 AM
3.0.1+23 Mar 08 2017 03:32 PM Mar 08 2017 03:32 PM
3.0.1+21 Jan 26 2017 12:46 PM Jan 26 2017 12:46 PM
3.0.1+20 Jan 26 2017 12:39 PM Jan 26 2017 12:39 PM
3.0.0 Aug 11 2016 10:52 AM Aug 11 2016 10:52 AM
2.0 Nov 25 2009 03:34 AM Jun 10 2016 04:10 AM

 

No collaborators yet.
     
5.00 / 3
  • Nov 25 2009 03:34 AM
  • May 15 2019 11:36 AM
  • 12,535
  • 13,428
  • 5,272