This is an old post from 2011. As such, it might not be relevant anymore.
It was hard to track down if these two features were possible with the latest Amazon S3 SDK, but they are and have documented them for you below.
// Create Amazon S3 instance $s3 = new AmazonS3(); // Send a file to Amazon S3 // Note we are calling batch() $response = $s3->batch()->create_object('myBucket','myFile.jpg', array( 'fileUpload' => fopen('myFile.jpg', 'r') )); // Send another file to Amazon S3 $response = $s3->batch()->create_object('myBucket','myOtherFile.jpg', array( 'fileUpload' => fopen('myOtherFile.jpg', 'r') )); // We have batched all of the files, now send $s3->batch()->send();
// Create Amazon S3 instance $s3 = new AmazonS3(); // Send a file to Amazon S3 // Note we are using the 'body' parameter and not the 'fileUpload' $response = $s3->create_object('myBucket','myFile.txt', array( 'body' => 'Hello, I was dynamically streamed to this file.' ));