Skip to content

Instantly share code, notes, and snippets.

@kkuchta
Created March 21, 2012 22:00
Show Gist options
  • Save kkuchta/2153571 to your computer and use it in GitHub Desktop.
Save kkuchta/2153571 to your computer and use it in GitHub Desktop.
<?php
require_once( 'sdk-1.5.3/sdk.class.php' );
$s3 = new AmazonS3();
// Send a text file up as a silly mime type.
$bucket = 'kkuchta-testing';
$filename = 'test.txt';
$opts = array(
'fileUpload' => '/Users/kevin/tmp/test.txt',
'contentType' => 'application/octet-stream'
);
// Pull the file back down.
$s3->create_object($bucket, $filename, $opts );
file_get_contents( 'https://s3.amazonaws.com/kkuchta-testing/test.txt' );
var_dump($http_response_header); // Shows contentType as octet-stream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment