Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tutorial for PHP Amazon Simple Storage Service [closed]

Tags:

php

amazon-s3

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.

like image 315
John Avatar asked May 24 '11 02:05

John


3 Answers

If you're using Zend, the S3 section has a great tutorial.

  1. http://framework.zend.com/manual/en/zend.service.amazon.s3.html

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.

like image 121
mr-sk Avatar answered Oct 04 '22 15:10

mr-sk


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.

like image 29
Geoff Appleford Avatar answered Oct 04 '22 13:10

Geoff Appleford


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.

like image 39
eykanal Avatar answered Oct 04 '22 14:10

eykanal