Amazon S3 file storage example

Hi There,

Does anyone have an example of an S3 spring.xml configuration they could share?

Many thanks

Hello,

To add support for Amazon S3 you need to go following steps:

  1. Add

<bean name="cuba_FileStorage"
          class="com.haulmont.cuba.core.app.filestorage.amazon.AmazonS3FileStorage"></bean>

to your spring.xml (core module)

  1. Add Amazon settings to app.properties (core module):

cuba.amazonS3.accessKey = <Access Key>
cuba.amazonS3.secretAccessKey = <Secret Access Key>
cuba.amazonS3.region = <Region>
cuba.amazonS3.bucket = <Bucket Name>

I’ve attached sample project

Regards,
Gleb

AmazonS3.zip (19.5K)

Many thanks Gleb.

Is there a reference anywhere to all of the cuba_ features/beans that can be overridden via Spring.xml?

Unfortunately we have no such list.

You can investigate the source code of the platform right in your project. Open it in IDE and search for “@Component” in libraries. Every bean in cuba-*.jar can be overridden in your spring.xml of a respective module. At the moment, there are almost 200 beans in CUBA.

That’s useful - thank you.

A post was split to a new topic: Upload image to Amazon S3 bucket