Created
March 21, 2012 22:00
-
-
Save kkuchta/2153571 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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