Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imageUploadToS3 Config #131

Open
sbyshyp opened this issue May 8, 2024 · 0 comments
Open

imageUploadToS3 Config #131

sbyshyp opened this issue May 8, 2024 · 0 comments

Comments

@sbyshyp
Copy link

sbyshyp commented May 8, 2024

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)
          }
        }
      })
    })()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant