Storage3

Gravatar
Posted by apokalyptik

News: Aug 24, 2007: Michael T. provided a patch to fix some date issues he was having with amazon aws. I have not verified this yet, but seeing as I’m not precisely sure when I will be able to verify it I figured I would put his code up here for you to download if you’re experiencing authentication issues like he was! Get it here: Patched Storage3 Class

Current Version: 1.0.1

CHANGELOG

  • 1.0.0
    • Initial Public Release
  • 1.0.1
    • Added function fileExists($s3bucket, $s3file)
    • Added support for listing bucket files for buckets with over 1,000 files
    • Added contributed function setACL($s3bucket, $s3file, $shorthand=public-read)
    • Added support for setting an objects acl during the upload process
    • Added grabbing of response headers (which contain a LOT of userful information)
    • s3test.php includes an example of using headers to verify the integrity of a file stored in s3 via md5 hash

This is a revised version of the file posted here: http://blog.apokalyptik.com/storage3.phps and includes:

  • A local, modified, version of the pear HTTP/Request package
  • A local copy of all other required pear packages
  • Documentation (under development… docs arent my strong suite)
  • An example application (s3test.php)

Cheers!
–Apokalyptik

5 Responses

  1. Lars Olesen says:

    I have a problem when using the code. I get the following response from Amazon.

    [Code] => AccessDenied
    [Message] => AWS authentication requires a valid Date or x-amz-date header
    [RequestId] => – REMOVED BY APOKALYPTIK -
    [HostId] => – REMOVED BY APOKALYPTIK -
    [int] => 403

    Any idea what the error might be? I use your sample code.

  2. apokalyptik says:

    My guess would be that you’re using the default bucket name… Which is already taken (bucket names have to be unique through out the entire S3 service, not just per user.

    And be careful about giving out your access keys! :)

  3. Lars Olesen says:

    Thanx. Well, I managed to get the buckets created – the program gives no error, and I checked if they are present using the s3-extension to Firefox. It is when I upload a file, the error occurs.

  4. [...] Storage3 Project – the predecessor of the AWS Test Utility package, provides file Storage3.php plus the required PEAR modules (making it easy to install on a remote server where PEAR can’t be invoked). [...]

  5. [...] Storage3 PHP Class for Amazon S3 Probably the best set of PHP tools for Amazon’s Simple Storage Service that I’ve been able to find. (tags: PHP S3 AWS Programming) This entry was written by PJ Doland, posted on January 11, 2008 at 1:28 am, filed under del.icio.us Links. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL. « links for 2008-01-10 [...]

Trackback URL for this entry