thaiphan / magento2-s3

Use Amazon S3 as the file storage solution for your Magento 2 application
MIT License
142 stars 95 forks source link

Upload Images inside a custom folder of S3 Bucket #53

Closed atishgoswami closed 3 years ago

atishgoswami commented 6 years ago

Hi,

First of all thanks for creating the extension, it's amazing.

Want to know if there is a capability in the assign custom folder of S3 bucket to upload the images into. For example, I have an S3 bucket name s3sharednewdev inside which I have a folder magento-stg in which I would like to see the images from pub/media get uploaded. So my upload path becomes: s3sharednewdev/magento-stg

Is there a configuration where I can do this ? or is it something the module does not support at this point of time?

Thanks

thaiphan commented 6 years ago

Hi @atishgoswami,

Magento has a security mechanism that means that you have to clearly indicate which folders in the media folder you want to sync. However, that's something that I haven't overwritten yet to allow users to customise. Sorry. :(

I'll add it to the backlog of things that I need to do.

Regards,

Thai

vijaydcyb commented 6 years ago

Hi @thaiphan ,

After installation when we run the command php bin/magento s3:storage:export By default where would the images would be exported. at the root folder of the bucket ?

Thanks

simondotwhite commented 6 years ago

@vijaydcyb to the best my knowledge it would be the root of the bucket.

thaiphan commented 3 years ago

There's too much work to be done on this extension. My extension supports the default folders out of the box. If you want to support a custom folder, you'll need to write the following custom code:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <system>
            <media_storage_configuration>
                <allowed_resources>
                    <custom_folder>custom</custom_folder>
                </allowed_resources>
            </media_storage_configuration>
        </system>
    </default>
</config>