helios-ag / FMElfinderBundle

:file_folder: ElFinderBundle provides ElFinder integration with TinyMCE, CKEditor, Summernote editors
MIT License
275 stars 128 forks source link

AWS S3 upload issue #388

Closed napestershine closed 4 years ago

napestershine commented 4 years ago

I am trying to configure S3, but it seems not working.

fm_elfinder:
  instances:
    default:
      locale: '%kernel.default_locale%'
      editor: ckeditor
      connector:
        debug: true
        roots:
          uploads:
            show_hidden: true
            driver: Flysystem
            url: '%aws_s3.base_url%/%aws_s3.bucket_name%'
            flysystem:
              type: aws_s3_v3
              options:
                aws_s3_v3:
                  version: 'latest'
                  key: '%aws_s3.access_key%'
                  secret: '%aws_s3.secret_key%'
                  region: '%aws_s3.region%'
                  bucket_name: '%aws_s3.bucket_name%'
            path: posts/content
            upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
            upload_deny: ['all']
            upload_max_size: 2M
helios-ag commented 4 years ago

I made small fix in 10.0.2, btw used following config. Worked fine. Just replace placeholders with your own values. Don't forget to install required dependencies:

  composer require barryvdh/elfinder-flysystem-driver
  composer require league/flysystem-aws-s3-v3
fm_elfinder:
    instances:
        default:
            locale: %locale% # defaults to current request locale
            editor: ckeditor # other options are tinymce, tinymce4, form, custom and simple
            fullscreen: true # defaults true, applies to simple and ckeditor editors
            connector:
                debug: false # defaults to false
                roots:       # at least one root must be defined
                      aws_s3:
                          driver: Flysystem
                          path: uploads
                          url: 'http://[my-bucket-name].s3.[region].amazonaws.com'
                          tmb_url: 'self' # For thumbnail generation on aws
                          flysystem:
                              type: aws_s3_v3
                              options:
                                aws_s3_v3:
                                    verion: 'latest'
                                    key: 'MY_AWS_KEY'
                                    secret: 'MY_AWS_SECRET'
                                    region: 'MY_AWS_REGION'
                                    bucket_name: 'MY_BUCKET_NAME'
                          upload_allow: ['all']
napestershine commented 4 years ago

Hi,

I am sorry. I forgot to update. I made it work already 2 weeks back. I was on vacation so couldn't update.

BTW thanks so much for attention and updates.

I will update my configs as above.

Thanks