OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce Attachments KnpGaufretteBundle and AmazonS3

This topic contains 5 replies, has 3 voices, and was last updated by  zhex900 3 years, 11 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #32661



    I am trying to use AWS S3 to store attachments. Here are my configure files.
    app/console cache:clear --env=prod -vvv had no errors.

    I have added this "aws\/aws-sdk-php":"3.*", to composer.json. Run composer update --no-dev

    After uploading a product image, the image path still points to my localhost.

    I cannot get much help from this post.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
  • #32662


    Hi, thanks for your question.

    I have such information:
    We use Gaufrette as a repository. There are no direct links to Amazon because we should check if attachment is available to the current user.
    So we handle requests for attachments always. We check if there is an access, and if there is – we climb into the repository (local / Amazon, etc.) and returns the contents of this attachment.

    Exclusion is generation of image thumbnails (prod mode, in dev mode the kernel will always handle it). If here is a request for the thumbnail and it is are not already generated, we take the source image from the repository, generate the thumbnail, put it in the media folder and return to the client. If you make a request for this image one more time – the generated image from the media folder will be rendered without application loading and in this case the links will lead to our instance, not to the Amazon.



    Thank you for a detailed response.

    My aim is to use AWS S3 as the attachment repo. In addition to what I have already done, what further configuration is required? Do I need to manually copy the existing local attachment folder to S3? Also since there are no direct links to AWS, how do I know if ORO is getting the image from local or AWS.


    Yurii Muratov

    Hello, zhex900.

    There is no additional configuration. You did everything right.

    Yes. If you ave some data in the app/attachment folder, then copy this files to your S3 instance.

    How to check that now local storage does not uses. You can delete or cleanup your app/attachment folder and upload some new image. For example, you can edit some user and add an avatar to his/her profile (Avatar field in edit user page). After you save this user, you will be able to find your uploaded file in your S3 bucket, but it will not be available in app/attachment folder.



    One more question.

    When image is missing in media/cache/attachment/resize/ but it can be found in app/attachment


    Why is it?



    Do I need to rebuild the image cache? How do I do that?

Viewing 5 replies - 1 through 5 (of 5 total)

The forum ‘OroCommerce’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No