OK, here is a super simple stripped down S3 that invokes curl. The SHA-1 class is weird and terrible, I snagged it from an old project. Frankly, I think someone snagged it for that too (different style than the rest of that project), but there were no credits to pass on. The Base64, HMAC_SHA1, and AmazonS3 are all new, use as you wish.
Usage would be something like:
AmazonS3 s3 ("MYCREDENTIALS", "myprivatekey");
S3Object obj ("TheS3Bucket", "TheObjectID");
// Fetch "TheObjectID" from TheS3Bucket and store it in ~/test
// If it fails, print the result part of the returned header
if (! s3.getObject (obj, File (CharPointer_UTF8 ("~/test"))))
// Put ~/test in TheS3Bucket as TheObjectID
// If it fails, again print the result from the HTTP header
if (! s3.putObject (obj, File (CharPointer_UTF8 ("~/test"))))
I’ve only tested this curl version on Mac, though it is coded to use .\curl.exe on Windows. It also uses https, so if your Curl isn’t setup for secure credentials, you’ll want to change AmazonS3::createURL to use http instead. When I get a chance, I’ll clean up the URL extensions and post a non curl version. Though, like I said above, creating the stupid credentialed URLs is the hard part.