I'm about to integrate Amazon Simple Storage Service (S3) with a php web application that must maintain a lot of office documents and photoshop files.
Can anyone point me to a brief tutorial on how to do this? There's "too much" documentation on the Amazon website for me to wade through. I learn best by studying and tinkering with code that actually works.
If you're using Zend, the S3 section has a great tutorial.
If not, but don't want to roll your own code, try this:
http://undesigned.org.za/2007/10/22/amazon-s3-php-class
The basics are pretty ... basic:
$s3 = new S3('accessKey', 'secretKey');
$s3->putBucket('bucket', S3::ACL_PUBLIC_READ);
$s3->putObjectFile('file.doc', 'bucket', 'docs/file.doc', S3::ACL_PUBLIC_READ);
$s3->deleteObject('bucket', 'docs/file.doc');
Or this:
https://github.com/tpyo/amazon-s3-php-class
Which is a great library - I've used it. I prefer it to Zend S3.
I would use the official SDK for php from Amazon.
Start with the Getting Started Guide, and then consult the full library docs as needed.
If you are new to S3, the general getting started guide should be useful in giving a general overview of how the service works.
This very nice tutorial comes with an added bonus; it links to an already-written library, so you won't have to write all the code yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With