Amazon S3 PHP helpers

Posted by Tom on April 18th, 2008 — in AWS, Internet, PHP, Programming, S3

The Amazon documentation for using S3 with PHP refers to an elusive function called “setAuthorizationHeader”. It’s apparently supposed to magically set the correct value for the Authorization header on a Pear HTTP_Request object. As far as I could tell, it didn’t actually exist — but I wanted it, so I wrote it:

Source

<?php

require_once ‘Crypt/HMAC.php’; require_once ‘HTTP/Request.php’;

define("S3URL", ‘http://s3.amazonaws.com’); define("AWSACCESSKEYID", [...]


Home Blog 280 North SCEC-VDO Wator World X TOOBS Wikipedia Fun Kegbot EasyButton JavaScript x0xb0x XBMC iPhone