pastebin

Paste Search Dynamic
Recent pastes
rmdir directory
  1. <?php
  2. require_once 'AWSSDKforPHP/sdk.class.php';
  3. $s3 = new AmazonS3();
  4. $s3->register_stream_wrapper();
  5. $directory = 's3://my-new-bucket';
  6. $filename = $directory . '/put.txt';
  7. $contents = '';
  8. )
  9. if (mkdir($directory))
  10. {
  11.     if (file_put_contents($filename, 'This is some sample data.'))
  12.     {
  13.         $handle = fopen($filename, 'rb+');
  14.         $contents = stream_get_contents($handle);
  15.         fclose($handle);
  16.     }
  17.     rmdir($directory);
  18. }
  19. echo $contents;
  20. ?>
Parsed in 0.030 seconds