My problem is that I upload all my products using the import function on Magento, it is easier to upload products in bulk using a CSV file in this way.

I have a field for images, and I upload all my images first on S3 bucket which I have set my origin in Cloudfront to fetch these images. So everything is setup fine regarding displaying the images on CloudFront if I add the absolute URL of the image path in the browser my image shows fine, so this is the image URL I add to my CSV file for Magento to find and upload my images according to each product.

So once I upload my products via a CSV file Magento fetches my images from S3 bucket and adds them to Magento folders. Now I have uploaded my images but they not showing from CloudFront rather from the same server as Magento. The next step I create the same folder structure as Magento for my images and CSS files and upload all the images and files to S3 bucket. Then I go to Magento backend and change the Base Site/Media URL to CloudFront, this now fetches my images and files from Cloudfront.

Now my file name for the images once fetched has the CloudFront URL I added in my backend and adds the absolute URL also as a filename from my CSV file I added, so the filename is terribly long and looks cumbersome. Also now I have a duplication of images on my Magento server and S3 and every time I want to upload more images I have to copy all the folders and files from Magento server to S3, this is a long tedious process.

Please advice what I am doing wrong and if there is a way I can do this better and more efficient?

1 Answer 1


As per my understanding, I am not sure what is going wrong at your end but I will suggest you to use this extension (https://github.com/thaiphan/magento2-s3) to achieve the same for Magento2. This extension will upload all your media stuff directly to S3 bucket instead of uploading on your server and then copy to S3 bucket. I have also used the same extension for Magento 1.9.x (https://github.com/thaiphan/magento2-s3) and this is working fine.

Try this and share your experience with me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.