magento2-s3 icon indicating copy to clipboard operation
magento2-s3 copied to clipboard

Magento loads the media files on the server and in s3

Open ayalamauric opened this issue 7 years ago • 4 comments

Hi @thaiphan , I had no problems installing the extension, in fact, the images are loaded in the bucket of s3, but also loaded on the server, something I want to avoid with this extension. I installed something wrong? Or the extension works like this? I upload the logs: `ubuntu@magento:/var/www/html/nuevo$ sudo php bin/magento s3:storage:export You are already using S3 as your media file storage backend! ubuntu@magento:/var/www/html/nuevo$ sudo php bin/magento s3:storage:enable You are already using S3 as your media file storage backend! ubuntu@magento:/var/www/html/nuevo$ sudo /etc/init.d/apache restart sudo: /etc/init.d/apache: command not found ubuntu@magento:/var/www/html/nuevo$ sudo /etc/init.d/apache2 restart [ ok ] Restarting apache2 (via systemctl): apache2.service.

but

1 2 3

What happens if I delete the theme and catalog folders from the ssh? How do I know if the images are loaded from s3?

I want Magento not to download files to the file system, how can I configure the static media URL to point to S3?

ayalamauric avatar Jan 16 '18 15:01 ayalamauric

@ayalamauric What happens if I delete the theme and catalog folders from the ssh? How do I know if the images are loaded from s3?

what do you mean by theme and catalog folders. If you mean, pub/static directory, then keep in mind that this extension only works for media. Static content will not be synced with AWS S3.

If you mean catalog folders in pub/media, then nothing will go wrong.

I want Magento not to download files to the file system, how can I configure the static media URL to point to S3?

Once you install this extension and configure it correctly using your S3 keys, then it should automatically pull media from S3. No need to do any additional configuration, unless you also want to set up CDN for media delivery.

pranavgaikwad avatar Mar 04 '18 05:03 pranavgaikwad

Hey @ayalamauric. Did you manage to solve this downloading images on server issue? Unfortunately I got there the same :( (Magento 2.2.4) It seems like Magento's bug.

n0kit31 avatar Nov 25 '18 17:11 n0kit31

@thaiphan, @pranavgaikwad The ISSUE is aroundSaveFileToFilesystem and return $subject->getStorageFileModel()->saveFile($file->getData(), true);

Why do you want to save file from S3 to local media storage?!

n0kit31 avatar Nov 25 '18 18:11 n0kit31

Reviving this issue because I am having what I believe to be the same issue as the OP. I see that I have successfully installed and exported media to S3 and configured CDN to pull images from S3. Great. I have also put the CDN url into the Magento admin "Base URL for User Media Files" (magento 2.2.4) as according to the readme.md ... "If you have enabled S3 integration then you can safely delete the images off your file system (although please take a backup just in case). If you want Magento to not download files to the file system, you can configure your static media URL to point to S3 or CloudFront."

The images are still being uploaded and stored into my pub/media folder. What did we miss , or misunderstand, here to avoid image storage on the local server ?

Thank you!

writemcodeboy avatar Jun 10 '19 15:06 writemcodeboy