Blog // Posts tagged with amazon-s3

 

Updated documentation for the Amazon S3 PHP class

I've just finished a massive overhaul of the S3 PHP Class documentation.

This update includes examples for every method (none of which have been tested). If you find any errors or inconsistencies, please drop me a line.

15 Aug 2009 
1 comment

 
 

Wordpress plugin for Amazon S3

I've created a very simple Wordpress plugin for Amazon S3 which uses my Amazon S3 PHP class.

Currently it allows you to upload files to an S3 bucket and insert them into your post when adding media.

Please note that PHP 5 and the CURL extension are required.

Download the latest version of the plugin.

To install place s3uploader.php into your wp-content/plugins/ directory. After activating the plugin you will need to configure your AWS credentials under Settings - Amazon S3 and select the bucket you would like to upload to.

Planned features for upcoming releases
  • Image resizing
  • Bucket browsing functionality under the media library
Changelog
  • 0.2 (2009-03-07):
    Some improvements and support for file downloads and flash movies
  • 0.1 (2009-02-16):
    Initial release

16 Feb 2009 
2 comments

 
 

Amazon S3 PHP Class

This class is a standalone Amazon S3 REST implementation for PHP 5.2.x (using CURL), that supports large file uploads and doesn't require PEAR.

Download source:

Example usage (also see example.php and the class documentation):

                      $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');

Writing and reading resources:

                      # Upload an object from a resource (requires bytesize):
$s3->putObject($s3->inputResource(fopen($file, 'rb'), filesize($file)), $bucketName, $uploadName, S3::ACL_PUBLIC_READ);
# Download an object to a resource:
$s3->getObject($bucketName, $uploadName, fopen($savefile, 'wb'));

Known Issues:

  • Files larger than 2GB are not supported on 32 bit systems due to PHP's signed integer problem
  • SSL is enabled by default and can cause problems with large files. If you don't need SSL, disable it with S3::$useSSL = false;

More Information:

Changelog

  • 0.4.0 (2009-07-20):
    Updates to copyObject, new getHttpUploadPostParams method for form uploads and fixes for 0 byte PUTs
  • 0.3.8 (2008-12-16):
    Support for spaces and special characters in URIs
  • 0.3.7 (2008-11-27):
    Support for CloudFront and changes to setBucketLogging()
  • 0.3.6 (2008-10-23):
    PHPDoc comment updates
  • 0.3.5 (2008-10-08):
    Added getAuthenticatedURL() and an ACL parameter to copyObject()
  • 0.3.4 (2008-09-11):
    Small updates and support for 0 byte data
  • 0.3.3 (2008-07-30):
    Fixed minor getBucket() bugs, added delimiter
  • 0.3.2 (2008-07-12):
    Fixed ?logging bug and changed putObject() to accept request headers (thanks to Angelo Mandato for providing details)
  • 0.3.1 (2008-06-20):
    Added copyObject() and updated README.txt
  • 0.2.9 (2008-06-20):
    Added getBucketLocation() and a location parameter to putBucket() for EU buckets
  • 0.2.8 (2008-06-06):
    Added sort() for AMZ meta headers (thanks Malone)
  • 0.2.7 (2008-05-30):
    Commented out uncommented var_dump() (thanks Chris)
  • 0.2.6 (2008-05-29):
    Replaced isset() with array_key_exists() since isset() was ignoring null parameters (thanks Joe)
  • 0.2.5 (2008-05-29):
    Added support for ?location and ?torrent parameters (thanks Joe)
  • 0.2.4 (2008-05-27):
    Fix for ?prefix bug (thanks Lucas)
  • 0.2.3 (2008-05-04):
    Small bug fixes, updated examples and comments, moved source to SVN
  • 0.2.2 (2008-05-02):
    Added S3 wrapper example
  • 0.2.1 (2008-04-28):
    First 0.2 beta (0.1 development discontinued)

Amazon S3™ is a trademark of Amazon.com, Inc. or its affiliates.

22 Oct 2007 
244 comments

 

Latest tweets

Never buy an ATI graphics card if you're going to be running Linux. # Yesterday at 3:23 PM

@WendyRobb Counting bare feet on my way out # Yesterday at 3:16 PM

And put some f*cking shoes on you dirty hippies! # Yesterday at 2:37 PM

Home | Blog | About | Contact | Copyright © Donovan Schönknecht Top