Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento loads the media files on the server and in s3 #30

Open
ayalamauric opened this issue Jan 16, 2018 · 4 comments
Open

Magento loads the media files on the server and in s3 #30

ayalamauric opened this issue Jan 16, 2018 · 4 comments

Comments

@ayalamauric
Copy link

ayalamauric commented Jan 16, 2018

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?

@pranavgaikwad
Copy link

pranavgaikwad commented Mar 4, 2018

@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.

@n0kit31
Copy link

n0kit31 commented Nov 25, 2018

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
Copy link

n0kit31 commented Nov 25, 2018

@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?!

@writemcodeboy
Copy link

writemcodeboy commented Jun 10, 2019

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants