title: Amazon s3 batch upload
body: <p>I have been trying to do batch upload using s3 client <code>execute()</code> method. It keeps throwing exception:</p>
  
  <blockquote>
    <p>Message: Argument 1 passed to Aws\AwsClient::execute() must implement interface Aws\CommandInterface, array given, called in....</p>
  </blockquote>
  
  <p>Even after following the example code from the doc.</p>
  
  <p>Check this example maybe I am doing something wrong:</p>
  
  <pre><code>$bucket   = 'myBucket';
  $commands = [];
  
  $s3 = new Aws\S3\S3Client([
      'version' =&gt; 'latest',
      'region'  =&gt; 'us-west-1',
  ]);
  
  $commands[] = $s3-&gt;getCommand('PutObject', [
      'Bucket' =&gt; $bucket,
      'Key'    =&gt; 'key1.gif',
      'Body'   =&gt; 'PATH_TO_FILE_1',
  ]);
  
  $commands[] = $s3-&gt;getCommand('PutObject', [
      'Bucket' =&gt; $bucket,
      'Key'    =&gt; 'key2.gif',
      'Body'   =&gt; 'PATH_TO_FILE_2',
  ]);
  
  $s3-&gt;execute($commands);
  </code></pre>
  
  <p>Thanks in advance!</p>