Skip to content

imageUploadToS3 Config #131

@sbyshyp

Description

@sbyshyp

I can't find any clear documentation on configuring a S3 bucket for the image upload for the particular method I'm trying to use.

// kms_froala_editor.yaml
kms_froala_editor:
    serialNumber: '%env(FROALA_ACTIVATION_CODE)%'
    language: en_ca
    includeJS: true
    includeCSS: true
    htmlRemoveTags: ["base"]
    imageUploadToS3:
      bucket: '%amazon_bucket%'
      region: '%amazon_region%'
      keyStart: 'uploads/images'
      accessKeyId: '%amazon_key%'
      acl: 'public-read'

When I go to submit an image I get the following error in the browser

POST https://us-east-1.amazonaws.com/bucket net::ERR_NAME_NOT_RESOLVED

The region and bucket name conform to the aws s3 set.

I based my config on this code block:

// src/Resources/public/froala_editor/html/image_s3_upload.php
    (function(){
      new FroalaEditor("#edit",{
        enter: FroalaEditor.ENTER_P,
        fileUploadToS3: {
          bucket: '<?php echo $bucket; ?>',
          region: '<?php echo $region; ?>',
          keyStart: '<?php echo $keyStart; ?>',
          params: {
            acl: '<?php echo $acl; ?>',
            AWSAccessKeyId: '<?php echo $accessKeyId; ?>',
            policy: '<?php echo $policy; ?>',
            signature: '<?php echo $signature; ?>',
          }
        },
        events: {
          'image.uploadedToS3': function(link, key, response) {
            console.log ('S3 Link:', link)
            console.log ('S3 Key:', key)
          }
        }
      })
    })()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions