How can I use Amazon S3 server to save my attachments?
    • Users can save their files on Amazon Server by Creating a New Profile for Amazon S3 or by selecting Amazon S3 in the default server settings and integrate it with their respective Amazon S3 server.

    Setup►Install Packages► Configure► Amazon S3

    Instance Storage Server Setting-

    Follow the below steps to create a Storage Profile for Amazon S3:

    1. Click on the New Profile or default Storage Profile for creating Amazon S3 Profile

    2. Select the Storage Type as Amazon S3.

    3. Provide the Access Key & Secret Key for your Amazon S3 server.

    4. Provide the bucket name used by your organization for Amazon S3(For detail settings on bucket name please refer Remote Site and CORS Settings for Amazon S3 explained below)

    5. Click on Save in order to save the Amazon S3 Storage Settings


                                                                                     Fig-7.1

      Remote Site Settings-

      While saving attachments on Amazon S3, user needs to specify the bucket name in which the attachment needs to be saved at the server side.

      While saving this setting, user might get the following error while saving the profile settings for Amazon S3 [Fig-7.2]




      Remote Site Setting Error.png


                                                                                         Fig-7.2


      To avoid this error user will have to add the following remote site settings to their salesforce instance:

      The below example will show how to add ‘multipart’ bucket settings to salesforce:

      1. Go to Setup ► Security Controls ► Remote Site Settings

      2. Create a new page with the following specification:

        1. Remote Site Name: Multipart

        2. Remote Site URL: https://multipart.s3.amazonaws.com

      3. Check the Active box

      4. Save the settings

      Note: In the above example, Remote Site Name can consist any name which the user prefer. The Remote Site URL should consist of the specified URL only with the respective bucket name in place of ‘multipart’.


      CORS Settings -

      When you save your settings a CORS setting will be done on your bucket, so that this application can access that bucket. If you like to restrict the permissions to bucket in anyways through CORS please go to your amazon account, and change the CORS configuration there as shown below.

      An example setting is given below which is likely be set by this application. This setting gives access to your bucket from any salesforce instance and application.




      Cors Setting-Amazon S3.PNG


                                                                                                               Fig-7.3

       




                                                                                    Fig-7.4