Question: I was asked how to save all the magento media assets in Amazon S3. I thought about using a PHP Stream Wrapper like this one: <https://github.com/punkave/aS3StreamWrapper> and just set the media folder to s3:\mybucket\mediaFolder

Does anyone has experience with this?

Or better use something like this: [https://github.com/sstoiana/magento-s3](https://github.com/sstoiana/magneto-s3)
But this extension doesn't look good. Any other recommendations?

Answer: 
it seems these guys find a solution: ( <http://thinkglobal.co/resources/moving-the-magento-media-directory-to-s3/> )

There are 2 possible approaches, one being to have Magento push all media assets to S3 as they are created and the other being to simply mount the media directory to an S3 bucket and let Magento think that it’s writing to the local disk. We chose the latter.

We ended up using a tool called s3fs, which uses a broader technology called fuse. With some fairly straightforward configuration (described below), you can get s3fs up and running. Be careful not to hardcode S3 bucket names or API access credentials if you are using AWS or other PAAS provider.

Make sure you replace the following variables with values for your specific configuration:

* {{S3\_BUCKET}} (name of your S3 bucket)
* {{API\_PUBLIC\_ACCESS\_KEY}}(provided by AWS)
* {{API\_SECRET\_ACCESS\_KEY}} (provided by AWS)
* {{UID}}(user id for nginx/apache user)
* {{GID}} (group id for nginx/apache user)
* {{MOUNTED\_DIRECTORY}} (path to your magento media directory)

Here is the setup:

```
yum install -y gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap

cd /usr/local/src
wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz
tar -xzf fuse-2.9.3.tar.gz
rm -f fuse-2.9.3.tar.gz
mv fuse-2.9.3 fuse
cd fuse/
./configure –prefix=/usr
make
make install
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
ldconfig
modprobe fuse
pkg-config –modversion fuse

wget http://s3fs.googlecode.com/files/s3fs-1.74.tar.gz
tar -xzvf s3fs-1.74.tar.gz
rm -f s3fs-1.74.tar.gz
mv s3fs-1.74 s3fs
cd s3fs
./configure –prefix=/usr
make
make install

echo “{{S3_BUCKET}}:{{API_PUBLIC_ACCESS_KEY}}:{{API_SECRET_ACCESS_KEY}}” > ~/.passwd-s3fs
chmod 600 ~/.passwd-s3fs

echo “user_allow_other” > /etc/fuse.conf

echo “s3fs#{{S3_BUCKET}} {{MOUNTED_DIRECTORY}} fuse use_cache=/tmp,allow_other,uid={{UID}},gid={{GID}} 0 0″ >> /etc/fstab

s3fs -o allow_other -o uid={{UID}} -o gid={{GID}} -ouse_cache=/tmp {{S3_BUCKET}} {{MOUNTED_DIRECTORY}}

```
Well, now that a couple years have gone by I think it's important to note that there are multiple plugins available that will move and serve assets from S3 / CDN.

Google searches turn up plenty of options. 

Here's one on GitHub:

<https://github.com/magefm/cdn>

Here's one on Magento's Connect marketplace:

<http://www.magentocommerce.com/magento-connect/aws-s3-cdn-for-product-images.html>

I have not tried these particular extensions yet but will be for an upcoming project. There are others out there, too.

I'd have to disagree with @Sonassi, using separate storage to allow the cheapest server configuration still with good performance is really considered the best practice today. For example, simply use S3 to move all static content off your web server helps the server use far less bandwidth and allow more concurrent users and less overall server power needed. And, if you're in a single datacenter like most people these days, and say it's in Dallas, then there's no doubt that people in Western Europe will be served much faster with a Global CDN like Cloudfront. So, using storage separate from your web server to lower bandwidth usage allows you to use only 1 server when you would need more sooner without this approach, and using CDN will greatly increase global load times.