title: How do I verify the file uploaded correctly to S3 with Perl Paws?
body: <p>I have uploaded a file to linode object storage (s3 compatible)</p>
  <p>However, I need to make sure that the file uploaded is correct.</p>
  <p>How do I verify the file uploaded using Paws or Net::Amazon::s3?
  these are mostly mp3 files</p>
  <p>EDIT
  Im now getting &quot;Forbidden&quot; on ContentMD5 inside PutObject
  its working fine when I remove that</p>
  <p>this is my current code</p>
  <pre><code>use Data::Printer;
  use Path::Tiny;
  use Paws;
  
  my $service    = 'S3';
  my $region     = 'ap-south-1';
  my $bucketname = 'KFC';
  
  my $file = 'MP3/hello.mp3';
  my $response;
  my $body;
  
  my $s3 = Paws-&gt;service($service, 
      region =&gt; $region,
      endpoint =&gt; 'http://ap-south-1.linodeobjects.com'
  );
  
  $response = uploadfile($file);
  p $response;
  
  sub uploadfile
  {
      my $arg1 = $_[0];
      my $fh = path($file);
      my $body = $fh-&gt;slurp;
      my $md5 = $fh-&gt;digest(&quot;MD5&quot;);
      $md5 = &quot;\&quot;&quot; . $md5 . &quot;\&quot;&quot;; # eq is not true if not for this &gt;_&lt;
      
      $response = $s3-&gt;PutObject(
          'Bucket'        =&gt; $bucketname,
          'ACL'           =&gt; &quot;public-read&quot;,
          'ContentType'   =&gt; 'audio/mpeg',
          'Key'           =&gt; $arg1,
          'ContentMD5'    =&gt; $md5,
          'Body'          =&gt; $body
      );
      
      print &quot;md5  = &quot; . $md5 . &quot;\n&quot;;
      print &quot;Etag = &quot; . $response-&gt;ETag . &quot;\n&quot;;
      if ( $response-&gt;ETag eq $md5) {
          return 1;
      } else {
          return 0;
      }
  }
  </code></pre>
  <p>Can you guys tell me if this is the best way to do it?</p>