# External storages

Support for uploading transforms to external services has been structured into what's called Storages. Imager X comes with built-in support for two storages, Amazon S3 (aws) and Google Cloud Storage (gcs), and is handled through the storages and storageConfig config settings. storageConfig is an array with keys corresponding to the handle of the different storages, like so:

'storageConfig' => [
    'aws' => [
        'accessKey' => '',
        'secretAccessKey' => '',
        'region' => '',
        'bucket' => '',
        'folder' => '',
        'requestHeaders' => array(),
        'storageType' => 'standard',
        'cloudfrontInvalidateEnabled' => false,
        'cloudfrontDistributionId' => '',
    'gcs' => [
        'keyFile' => '',
        'bucket' => '',
        'folder' => '',

This only adds the configuration for the storages, use storages to supply an array of storages to upload to:

'storages' => ['aws'] // uploads to AWS
'storages' => ['aws', 'gcs'] // uploads to both AWS and GCS (not sure why you would, but...)

Additional storages can be created by implementing the ImagerStorageInterface (opens new window), and registrering your class using the ImagerService::registerExternalStorage method, like so:

ImagerService::registerExternalStorage('aws', AwsStorage::class);


Configuring an external storages doesn't mean that the transform will automatically be served from that location, you still need to set your imagerUrl appropriately. Also, the transformed images are still kept in your imagerSystemPath and used for caching purposes.